0

Pytest results are written out as an xml test report - the job generates 2 xml reports. I have configured an Atlassian bamboo job to parse the report using JUnit parser (available in bamboo). It however only parses the first xml file and ignores the 2nd. Is there a way to parse both and display the test results in the Tests tab of the bamboo job?

Archie
  • 153
  • 9
  • It certainly can. With what expression did you configure the task? – Alex Jul 19 '22 at 08:44
  • Adding a single JUnit parser task and selecting the artifact as '*.xml' did not work. I tried creating two JUnit parser tasks, pointed each to read the specific xml file in the bamboo agent build-directory, and, dragged them under 'final' tasks. This seemed to work. Now the test results from both xmls are parsed. – Archie Jul 19 '22 at 11:57
  • 1
    This still tells me nothing about the the expression you use. Just paste the exact code. Here's mine that works: `**/target/surefire-reports/*.xml, **/target/jasmine/TEST-jasmine.xml, **/build/test-results/test/TEST-*.xml`. – Alex Jul 19 '22 at 12:25
  • Here are the expressions - tihs is what works for me `**/Test/file1.xml` and `**/Test/file2.xml` – Archie Jul 19 '22 at 12:30
  • Are using comma to separate them? Or do you see any other notable differences from my example? – Alex Jul 19 '22 at 12:57
  • I am not using comma to separate them. Notable difference - I created 2 JUnit parser tasks in the job, one for each xml. I could try your way of the comma separated expressions. – Archie Jul 19 '22 at 17:04
  • @Alex I tried the comma separated expression that you suggested and it works as well. I have a question - are you able to see the number of 'passed' tests (in green) . In my example I just see the 'new fails', 'existing fails', 'fixed' and 'skipped' tests. – Archie Jul 20 '22 at 15:22
  • 1
    Yes but only if you click on the job itself. I.e. url is `PROJECT-PLAN-JOB-X` instead of the summary url `PROJECT-PLAN-X`. The former states the green tests count as `The following X tests have passed: ...`. – Alex Jul 20 '22 at 16:18

2 Answers2

0

Adding a single JUnit parser task and selecting the artifact as '*.xml' did not work. I tried creating two JUnit parser tasks, pointed each to read the specific xml file in the bamboo agent build-directory, and, dragged them under 'final' tasks. This seemed to work. Now the test results from both xmls are parsed.

Archie
  • 153
  • 9
0

Although adding separate JUnit parser tasks, one for each xml artifact, a comma separated list of artifacts works as well (answer given by @Alex)

Archie
  • 153
  • 9