How to publish gradle test result in bamboo build?

1.7k views Asked by At

I am using bamboo build definition to build java code and also running tests but don't have idea about how to publish test result.

2

There are 2 answers

0
Alex On BEST ANSWER
  • When using Maven tasks, there's a checkbox "The build will produce test results.". This does 2 things: parses JUnit test results and breaks the build if it can't find any.
  • When using any other task, you have to add a (final) "JUnit Parser" task. This does the same as above. These are the patterns I use to cover both Maven and Gradle builds: **/target/surefire-reports/*.xml, **/target/jasmine/TEST-jasmine.xml, **/build/test-results/test/TEST-*.xml
0
Rameshwar On
  1. Atlassian Bamboo provides a task to parse unit test results. using Junit Parser.
  2. You can select task of type Junit Parser in build plan.
  3. You can add this to final as well but if your CI plan fails before it is able to generate the test results it will not shoe the reports and the final task will fail as well.
  4. You will have to provide relative path to test results generated after you test execution.
  5. If you provide a pattern like **/target/surefire-reports/*.xml it will pick up test results for all the submodules of a project.
  6. Use following link to see how documentation suggest to use this feature to parse your unit test results to show on bamboo UI. Bamboo Junit Parser Task.