What would be the junit test command for maven ?

Deleted user July 7, 2021

I want to integrate junit test execution with results in my CI bamboo pipeline . what would  be  command for maven ? how do i proceed? what will be the tasks ? 

 

2 comments

Suvradip Paul
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2021

Hi @[deleted] ,

Thanks for posting in community.

Did you check the below documentations available?

  1. https://docs.atlassian.com/bamboo-specs-docs/6.9.2/specs.html?java#task-test-results-parser
  2. https://confluence.atlassian.com/bamboo/maven-289277038.html

You can check the first line as it's the exclusive documentation.

There are something also in marketplace to import results and create tests but I think most of these are not part of bug bounty program. Link of xray-connector-for-bamboo - https://marketplace.atlassian.com/apps/1216932/xray-connector-for-bamboo?hosting=server&tab=overview 

Please accept the answer if it answers your query. If not, please respond and allow others to respond.

Stay safe and healthy.

Cheers

Suvradip

Deleted user July 8, 2021

Thank you for your reply .. I have gone through the document . I am getting error like this : 

simple 08-Jul-2021 15:26:39 Starting task 'Junit Test' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple 08-Jul-2021 15:26:39 Parsing test results under /home/bamboo/bamboo-agent-home/xml-data/build-dir/ELLIPSE-ER-JOB1...
simple 08-Jul-2021 15:26:39 Failing task since test cases were expected but none were found.
simple 08-Jul-2021 15:26:39 Finished task 'Junit Test' with result: Failed

Richard White _TechTime_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 20, 2021

Hi @[deleted] ,

There are two things you need to do:

1. run the correct command to run the tests as part of your build

2. configure and run the junit parser to locate the test results

First you need to ensure your tests are running in the build and that you know where the resulting test results files are being saved.

The most common command for running unit tests is `mvn test`, I would suggest running the command against the project locally, to determine where the test result files are being generated. I think by default, bamboo is looking for any xml files in a directory called "test-results".

The search pattern bamboo is using can be  controlled using the "Custom Results Directories" configuration of the JUnit parser.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events