Jenkins 1.647 - PhpUnit Test fail but build succesfull - testing

I have a Jenkins that run several task, included my tests with phpunit. Everything is working, the test are running but when a test fail the build is set like Succesfull and I don't get my notifications. I wanna that when a test fail, the build fail to notificate github and the developer too.
The notification system works OK when a build fail because I have migrations too that are working ok.
My phpunit.xml file look like this:
<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
cacheTokens="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
processIsolation="false"
stopOnError="true"
stopOnFailure="true"
stopOnIncomplete="true"
stopOnSkipped="true"
stopOnRisky="true"
strict="false"
timeoutForSmallTests="1"
timeoutForMediumTests="10"
timeoutForLargeTests="60"
verbose="true"
And this is one of the outputs of Jenkins.
There was 1 error:
Undefined index: payroll
/tmp/app/test/unit/payroll/PayrollTest.php:24
FAILURES!
Tests: 311, Assertions: 392, Errors: 1.
BUILD FINISHED
Total time: 2 minutes 17.89 seconds
[INFO] HipChat notification sent to the following rooms: app
Finished: SUCCESS
Hints ? Best regards.

Related

Mocha, Electron: Errors in testing

I was testing my electron app with mocha and got this error several times (and I'm still getting it!). Every time I run the program it returns with the error
> Executing task: npm run test <
> forte#1.0.0 test PATH TO PROJECT
> mocha ./tests/test.js
0 passing (3ms)
Test failed Failed to create session.
unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location \node_modules\spectron\lib\launcher.bat is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)
Just in case this is important, the part which says (The process started from chrome location \node_modules... actually had the whole path, not just that.
In my test.js file I have the code from the spectron home page, which you can view here. What is wrong with the test files?

Unable to Publish NUnit test result report getting error message stating, Could not read the XSL XML file

While publishing NUnit report in Jenkin getting an exception "ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author". I am using
.Net Core MVC App in C#
NUnit project
Jenkin
Using command "dotnet test ".\WebApp2nUnit\WebApp2nUnit.csproj" --logger:"trx;logFileName=Report.xml""
in freestyle jenkin project.
Although build success along with I could see test result report is forming but at the time of publishing this report getting below exception. I am using the NUnit plugin to publish this. Provided is the compete error message:
Test Run Successful.
Total tests: 3
Passed: 3
Total time: 5.3879 Seconds
C:\Program Files (x86)\Jenkins\workspace\WebApp2>exit 0
Recording NUnit tests results
Error in NUnit processing: Could not transform the NUnit report. Please report this issue to the plugin author
ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author
Finished: FAILURE
Please suggest.
Nishant
I added this package to my solution: https://www.nuget.org/packages/NunitXml.TestLogger/
Then the command used is:
dotnet test folder/project.csproj --filter "TestCategory=category" --results-directory ./folder/ --test-adapter-path:. --logger:"nunit;LogFilePath=TestResult.xml"
and to publish:
nunit testResultsPattern: 'folder/TestResult.xml'

How to configure kotlin test output in kotlin gradle DSL?

I have let gradle generate a gradle app for me (gradle init --type=kotlin-application).
It users kotlin-test (org.jetbrains.kotlin:kotlin-test) as test framework.
However, when I invoke "./gradlew build" and a test fails, I get output where the actual failed test assertion is missing, for example
de.eekboom.eeksv.SimplestTest > testStreaming FAILED
java.lang.AssertionError at SimplestTest.kt:48
5 tests completed, 1 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///D:/dev/eeksv/build> /reports/tests/test/index.html
I can of course, open the linked index.html for test results, but that is a bit annoying.
Only when I run that specific test (from within IDEA) I get more helpful output like
expected:<3> but was:<2>
java.lang.AssertionError: expected:<3> but was:<2>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
...
at de.eekboom.eeksv.SimplestTest.testStreaming(SimplestTest.kt:48)
When I use Java and the gradle groovy DSL, I can fix this by configuring the test task:
testLogging {
events TestLogEvent.FAILED // Show specific test failures in output
exceptionFormat = TestExceptionFormat.FULL // Output full failure details
}
How can I do the same for kotlin?

Jenkins return job status SUCCESS when the test failed

I am automating my protractor integration tests using Jenkins. When some of the tests fails Jenkins weeps saying that the result was successful. This is my output:
24 specs, 1 failure
Finished in 64.079 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
Test failed but keep the grunt process alive.
Done, without errors.[39m
Terminating xvnc.
$ vncserver -kill :28
Killing Xtightvnc process ID 24369
Finished: SUCCESS
I don't know if my problem is selenium or grunt related.
Does any one know what can be the problem? Thanks in advance!
Looks like this Jenkins job is not set up properly, I suggest you review your Job Configuration.
After some research I found out the problem.
I am using "grunt-protractor-runner" library. It has an option call "keepAlive" and it was set to true. This caused the process to continue even is something was wrong and not passing the error code to grunt.
After set it up to false everything behave as expected.

HttpHostConnectException let Apache Stanbol Integration Tests fail

I tried to install the Stanbol version from branch "release-0.12" from github.
On my system I have:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
When I start the command:
mvn install
I get the following error for the Apache Stanbol Integration Tests => error-log
The first lines of the error are:
06.08.2014 15:47:02.025 *INFO * [main] Setting org.osgi.service.http.port=8765
06.08.2014 15:47:02.026 *INFO * [main] Starting launcher ...
06.08.2014 15:47:02.030 *INFO * [main] HTTP server port: 8765
15:47:03,614 INFO StanbolTestBase:163 - Got HttpHostConnectException at
http://localhost:8765/ - will retry
When I skiped the test I also got no response from the server...
I already tried it with java-version 1.6, but there I got the error:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed
with message:
Java 7 or higher is required to compile this module
Has someone an idea what I made wrong (does it need some further software requirements)? Or how can I get the server running correctly?
The integration test starts a Stanbol Server (actually the full launcher) in its own JVM. The tests waits for up to 180 seconds for this server to start. During that time the test resends some test requests to check if the server is up and running.
Based on the provided log this period starts at about "15:47" so the test should wait until about "15:50" before it gives up.
Because of the line
^C15:48:42,236 INFO StanbolTestBase:146 - Got 404 at http://localhost:8765/entityhub - will retry
in the log my guess is that the build process was manually canceled with ^C before the server was fully started.
The server side logs of the test run are available at target/launchdir/stanbol/logs/error.log. If the integration tests do fail one will usually find the reason in this log file.