JUnit parser task fails to detect existing test results. I was able to reproduce the following inconsistent behavior. When I committed my xml test result file to my Git repo and checked out, Bamboo detected the test results:
.. simple 05-Feb-2013 11:12:33 Starting task 'MyParser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit' simple 05-Feb-2013 11:12:33 Parsing test results... simple 05-Feb-2013 11:12:33 Finished task 'MyParser' ..
Next, I removed the source repository checkout part, and manually copied the xml file to the build directory. The build failed with the following results:
simple 05-Feb-2013 11:16:02 Build PROJ1-PLAN1-JOB1-7 started building on agent Default Agent simple 05-Feb-2013 11:16:02 Build working directory is /Users/akhachatryan/Atlassian/BambooHome4.4.0/xml-data/build-dir/PROJ1-PLAN1-JOB1 simple 05-Feb-2013 11:16:02 Executing build PROJ1-PLAN1-JOB1-7 simple 05-Feb-2013 11:16:02 Running pre-build action: Build Number Stamper simple 05-Feb-2013 11:16:02 Running pre-build action: Clover Grails PreBuild Action simple 05-Feb-2013 11:16:02 Running pre-build action: VCS Version Collector simple 05-Feb-2013 11:16:02 Running pre-build action: Repository Isolation Enabler Action simple 05-Feb-2013 11:16:02 Running pre-build action: Maven Settings Prebuild Action simple 05-Feb-2013 11:16:02 Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 05-Feb-2013 11:16:02 Beginning to execute external process for build 'Project-1 - Plan-1 - Default Job'\n ... running command line: \n/bin/sh\n /var/folders/gl/0lz__sg17fn4z5gcl_lsb66m0000gp/T/PROJ1-PLAN1-JOB1-7-ScriptBuildTask-1148064727826435531.sh\n ... in: /Users/akhachatryan/Atlassian/BambooHome4.4.0/xml-data/build-dir/PROJ1-PLAN1-JOB1\n build 05-Feb-2013 11:16:02 total 8 build 05-Feb-2013 11:16:02 drwxr-xr-x 4 akhachatryan staff 136 Feb 5 11:15 . build 05-Feb-2013 11:16:02 drwxr-xr-x 5 akhachatryan staff 170 Feb 5 11:12 .. build 05-Feb-2013 11:16:02 -rw-r--r-- 1 akhachatryan staff 138 Feb 5 11:16 build-number.txt build 05-Feb-2013 11:16:02 drwxr-xr-x 4 akhachatryan staff 136 Feb 5 10:30 test-reports build 05-Feb-2013 11:16:02 build 05-Feb-2013 11:16:02 ./test-reports: build 05-Feb-2013 11:16:02 total 24 build 05-Feb-2013 11:16:02 drwxr-xr-x 4 akhachatryan staff 136 Feb 5 10:30 . build 05-Feb-2013 11:16:02 drwxr-xr-x 4 akhachatryan staff 136 Feb 5 11:15 .. build 05-Feb-2013 11:16:02 -rw-r--r--@ 1 akhachatryan staff 4219 Feb 17 2012 Passing_JUnit_Test.xml build 05-Feb-2013 11:16:02 -rw-r--r--@ 1 akhachatryan staff 195 Feb 5 11:15 new.xml simple 05-Feb-2013 11:16:02 Finished task 'Script' simple 05-Feb-2013 11:16:02 Starting task 'MyParser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit' simple 05-Feb-2013 11:16:02 Parsing test results... simple 05-Feb-2013 11:16:02 Failing task since test cases were expected but none were found. simple 05-Feb-2013 11:16:02 Finished task 'MyParser' simple 05-Feb-2013 11:16:02 Running post build plugin 'NCover Results Collector' simple 05-Feb-2013 11:16:02 Running post build plugin 'Clover Results Collector' simple 05-Feb-2013 11:16:02 Running post build plugin 'Artifact Copier' simple 05-Feb-2013 11:16:02 Running post build plugin 'Cleanup Build Processor' simple 05-Feb-2013 11:16:02 Finalising the build... simple 05-Feb-2013 11:16:02 Stopping timer. simple 05-Feb-2013 11:16:02 Build PROJ1-PLAN1-JOB1-7 completed. simple 05-Feb-2013 11:16:02 Running on server: post build plugin 'NCover Results Collector' simple 05-Feb-2013 11:16:02 Running on server: post build plugin 'Clover Delta Calculator' simple 05-Feb-2013 11:16:02 Running on server: post build plugin 'Build Hanging Detection Configuration' simple 05-Feb-2013 11:16:02 Running on server: post build plugin 'Maven Dependencies Postprocessor' simple 05-Feb-2013 11:16:02 All post build plugins have finished simple 05-Feb-2013 11:16:02 Generating build results summary... simple 05-Feb-2013 11:16:02 Saving build results to disk... simple 05-Feb-2013 11:16:02 Indexing build results... simple 05-Feb-2013 11:16:02 Finished building PROJ1-PLAN1-JOB1-7.
My new.xml file:
<?xml version="1.0" encoding="UTF-8"?> <testsuite name="TestFoo" time="0.000000" errors="0" failures="0" tests="1"> <testcase name="TestFoo" time="0.000000" status="run"> </testcase> </testsuite>
I tried to change the timestamp (touch -t 200805101024 test-reports/new.xml) of the test result file and than back (touch test-reports/new.xml), but it didn't make any difference.