Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,913
Community Members
 
Community Events
165
Community Groups

What would be the junit test command for maven ?

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

Hi @Upasana Ghosh ,

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

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

Hi @Upasana Ghosh ,

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
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

970 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you