• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 5.0.1
    • 4.3.3, 4.4, 4.4.5
    • Tests

      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.

            [BAM-12768] Inconsistent behavior when using Junit parser task

            I still have this problem with Bamboo version 5.12.3.1 build 51215 - 04 Jul 16.

            My test automation tool generates the junit xml output in the working directory of the bamboo job. I used the touch command on the output file as a task and the task # 3 to parse the output.

            Task #1 - run the automated tests

            Task #2 - touch command for the output files(one .xml file) - the actual touch command i used - 

            touch -am chrome52.xml

            Task #3 - junit parser with the pattern - */ST-ST-STC/.xml. ST-ST-STC is within

            <bamboo home>/xml-data/build-dir/

             

            Any pointer is much appreciated.

             

            Regards,

            Subu

            Subu baskaran added a comment - I still have this problem with Bamboo version 5.12.3.1 build 51215 - 04 Jul 16. My test automation tool generates the junit xml output in the working directory of the bamboo job. I used the touch command on the output file as a task and the task # 3 to parse the output. Task #1 - run the automated tests Task #2 - touch command for the output files(one .xml file) - the actual touch command i used -  touch -am chrome52.xml Task #3 - junit parser with the pattern - * /ST-ST-STC/ .xml. ST-ST-STC is within <bamboo home>/xml-data/build-dir/   Any pointer is much appreciated.   Regards, Subu

            Nicolas added a comment -

            Same here @Stefan Roels, feels like a bit random if the testfile is recognized or not. I'm pretty sure that I tried the path, which now worked, before and it didn't work. Anyway, it seems that Bamboo is not Atlassian's favourite product, given the support some addons and the server itself receive.

            Nicolas added a comment - Same here @Stefan Roels, feels like a bit random if the testfile is recognized or not. I'm pretty sure that I tried the path, which now worked, before and it didn't work. Anyway, it seems that Bamboo is not Atlassian's favourite product, given the support some addons and the server itself receive.

            ecoutin.boingo what was the pattern you were previously using and what did you expect it to do? We might have another bug or documentation issue here.

            James Dumay added a comment - ecoutin.boingo what was the pattern you were previously using and what did you expect it to do? We might have another bug or documentation issue here.

            @Stefan Roels

            Actually the only way I could get the Junit parser to work was by using that ANT path format and then doing the necessary adjustments in the test scripts to put the test results in that folder:
            */test-reports/.xml

            Using relative paths, which is the other alternative the documentation recommends didn't work for me.

            Einar Coutin added a comment - @Stefan Roels Actually the only way I could get the Junit parser to work was by using that ANT path format and then doing the necessary adjustments in the test scripts to put the test results in that folder: * /test-reports/ .xml Using relative paths, which is the other alternative the documentation recommends didn't work for me.

            Great to hear Stefan

            James Dumay added a comment - Great to hear Stefan

            After some fiddling around with the location of the test results the problem disappeared. I'm not sure what happened, but it is working fine now.

            Stefan

            Stefan Roels added a comment - After some fiddling around with the location of the test results the problem disappeared. I'm not sure what happened, but it is working fine now. Stefan

            benjamin.wolff the integrated Grails test reporting calls grails a second time after building to run the test goal. What you can do is disable the integrated grails tests, add another grails task that just calls the test goal and then configure the JUnit test parser task to pick up the test result files in the working directory.

            James Dumay added a comment - benjamin.wolff the integrated Grails test reporting calls grails a second time after building to run the test goal. What you can do is disable the integrated grails tests, add another grails task that just calls the test goal and then configure the JUnit test parser task to pick up the test result files in the working directory.

            Sorry forgot about the formatter. The setting is

            **/test-reports/*.xml

            Stefan Roels added a comment - Sorry forgot about the formatter. The setting is **/test-reports/*.xml

            Hi Marek,

            My test reports end up in the test_reports folder that sits directly in the root of my build folder. My JUnit Parser task has "*/test-reports/.xml" as reports directory setting.

            Regards,
            Stefan

            Stefan Roels added a comment - Hi Marek, My test reports end up in the test_reports folder that sits directly in the root of my build folder. My JUnit Parser task has "* /test-reports/ .xml" as reports directory setting. Regards, Stefan

            stefanroels Just to be sure - the path to reports matches files properly?

            Marek Went (Inactive) added a comment - stefanroels Just to be sure - the path to reports matches files properly?

              Unassigned Unassigned
              akhachatryan ArmenA
              Affected customers:
              13 This affects my team
              Watchers:
              23 Start watching this issue

                Created:
                Updated:
                Resolved: