I am trying to setup jenkins for my IOS app. The app is building successfully. But when I configure JUnit and give value test-reports/*.xml in Test report XMLs(Publish JUnit test result report) I get the following error
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
Finished: FAILURE
I have also added a xml file myself (test-report.xml) and give its path in Test report XMLs. Now when I build I get following error.
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: Test reports were found but none of them are new. Did tests run?
For example, /Users/Shared/Jenkins/Home/workspace/test_jenkins/test-report.xml is 4 hr 2 min old
Finished: FAILURE
Can you please help me in setting up JUnit.
Thanks in advance.
Related
I am trying to configure my Jenkins project to display the results of a JUnit XML report. However, the Jenkins project throws the below error when trying to display the JUnit XML during the build.
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
java.lang.NoClassDefFoundError: hudson/tasks/junit/JUnitParser$ParseResultCallable
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:90)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:120)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:137)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1765)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE
I have read that this error is possibly due to a mismatch between the JUnit version Jenkins is expecting and the version used by my project. How do I find out which version of JUnit Jenkins is expecting? Also, is there anything else that could cause the above error?
Error is thrown by JUnitResultArchiver. It is a dependency of Junit plugin. Go into the Jenkins and look for the version of JUnit Plugin.Then look at source code of that particular version on project's github: https://github.com/jenkinsci/junit-plugin
After doing that, you will have the exact version that it requires.
Another reason why you are seeing this error is that you have a different compile and runtime classpaths.
We have a Jenkins installation and some projects which are tested by NUnit. This works fine and it writes an NUnit results XML file.
Then we have a 'Publish NUnit test result report' post-build step. But since friday it produces this error:
Recording NUnit tests results
ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
java.io.IOException: remote file operation failed: C:\Jenkins\workspace\xxx at hudson.remoting.Channel#205d5d5c:CIAgent: java.io.IOException: Failed to read C:\Jenkins\workspace\xxx\temporary-junit-reports\TEST-xxx_Tests.TestsWithRealServers.TestWithTwoLocals_1_2.xml
at hudson.FilePath.act(FilePath.java:986)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:226)
[...]
Caused by: java.io.IOException: Failed to read C:\Jenkins\workspace\xxx\temporary-junit-reports\TEST-xxx_Tests.TestsWithRealServers.TestWithTwoLocals_1_2.xml
at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)
at hudson.tasks.junit.TestResult.parse(TestResult.java:175)
[...]
... 13 more
Caused by: java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
[...]
Archiving artifacts
Finished: FAILURE
The XML file is present in the working directory. I mentioned that the first line of this file looks like this:
<?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="xxx_Tests.TestsWithRealServers.TestWithTwoLocals" skipped="6" tests="6" time="">
So I guess it fails because the time attribe is empty.
Does anyone how I can fix this or why this error occurs?
Thanks!
Did you recently upgrade the jenkins JUnit plugin to 1.12? There is a reported issue in this update. You might try downgrading back to 1.11.
By the way, Jenkins plugins does not support Nunit 3 XML format. I also had a similar problem on Jenkins. I used to convert Nunit 3 result format to Nunit 2 format.
"C:\NUnit 3.5.0\nunit3-console.exe" /result:\MyApplication.xml;format=nunit2 "D:\Jenkins\workspace\MyApplication.Tests.dll"
I have Hudson configured for building a project.
And the console output, after building is, as follows:
Compiling ./main.py ...
Sorry: IndentationError: ('expected an indented block', ('./main.py', 8, 6, 'thread.start_new_thread( foo.FooThread, () )\n'))
Compiling ./udpReceiver.py ...
<<<<< build finished!
POST BUILD TASK : SUCCESS
END OF POST BUILD TASK : 0
Deleting project workspace...
done
Finished: SUCCESS
As you can see, I have an Indentation Error....and Hudson says that the build job finished with success.
What I want is something like this:
Check if the string "IndentationError" is presented on the console output text ... if so, than the build should be:
Finished: FAILED!!!!!!!!
How can I accomplish this?
I confirm that the Log Parser plugin can do the job to change the build status to failure.
Install the plugin and create a rule set for your Python build for example:
In the create the /var/lib/jenkins/logParserRules/python-error file:
error /IndentationError/
Next, update the Python build with these settings:
The build status will be changed to FAILURE:
Compiling ./udpReceiver.py ...'
Sorry: IndentationError: ('expected an indented block', ('./main.py', 8, 6, 'thread.start_new_thread( foo.FooThread, () )\n'))
Compiling ./udpReceiver.py ...
Build step 'Console output (build log) parsing' changed build result to FAILURE
Currently we are using IntelliJ, Scala, SBT to kick off our tests in our local enviroment. With SBT command line, we can specify specific test, suites, wildcards, as instructed here:
ScalaTest.org Page
Such as "test-only *RedSuite"
However on our CI Jenkins server, with the SBT pluging, when specifying this, it gives an error.
In the action field, the following values were used:
Action:compile test-only test.package.name
Using the following does work for ALL tests:
Action:compile test
[success] Total time: 240 s, completed Apr 28, 2014 12:29:36 PM
[error] Expected ID character
[error] Not a valid command: org (similar: export)
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: org (similar: fork, run, doc)
[error] org.company.scalatest.abc.regressionsuite
[error] ^
Build step 'Build using sbt' changed build result to FAILURE
Build step 'Build using sbt' marked build as failure
Recording test results
Does anyone know if there is a way we can pass these parameters through the jenkins SBT plugin?
This is a quoting problem, your Action field is parsed as 3 commands:
compile
test-only
org.company.scalatest.abc.regressionsuite
And it chokes because that org is not a valid command.
Using compile "test-only org.company.scalatest.abc.regressionsuite" should fix that.
I am using Jenkins for deployment process and it works fine. When i try to take rcov report rails stats report and brakeman warnings.
[ubuntu#xx.xxx.xxx.xx] executing command
** [out :: ubuntu#xx.xxx.xxx.xx] Starting Unicorn..
command finished in 2228ms
POST BUILD TASK : SUCCESS
END OF POST BUILD TASK : 0
ERROR: Publisher hudson.plugins.brakeman.BrakemanPublisher aborted due to exception
java.io.FileNotFoundException: /home/kannan/.jenkins/workspace/Publisher Dev/brakeman-output.tabs (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at hudson.FilePath.read(FilePath.java:1570)
at hudson.FilePath.readToString(FilePath.java:1595)
at hudson.plugins.brakeman.BrakemanPublisher.perform(BrakemanPublisher.java:99)
at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:146)
at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:331)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Publishing rails stats report...
Build failed, skipping rcov coverage report
Build step 'Publish Rcov report' marked build as failure
Finished: FAILURE
What am i supposed to do
Look at the error:
java.io.FileNotFoundException: /home/kannan/.jenkins/workspace/Publisher Dev/brakeman-output.tabs (No such file or directory)
This means Jenkins can't find the report generated by Brakeman. Either you have not set up the job correctly or Brakeman is failing for some reason. You should check the console output for Brakeman errors and verify you have configured the job correctly as described here.