It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to check test count?

Mark Hirota Sep 23, 2015

Let's say that I have a script that is invoked that runs my tests and produces a JUnit compatible results XML file.  Because I want to be able to quarantine failing tests in Bamboo, I therefore ignore the return code from the command invoked in the script.

However, this creates a scenario whereby the test runner could exit prematurely (say, due to an exception), without necessarily causing a test failure (an issue during test fixture?)

The overall test count would drop in this case.

Also, someone could cut out tests (let's assume unintentionally) so that they no longer run at all – also reducing the overall test count.

How can I enable a check for this in Bamboo, and cause a failure?

1 answer

1 accepted

0 votes
Answer accepted
Marcin Oles Atlassian Team Sep 23, 2015

Hi Mark,

I don't think there is such an option in Bamboo to verify the number of tests. In your case I'd recommend writing another script task which would analyze the JUnit report and fail if the number of tests is incorrect or if the file was not generated at all. Then after such script task you can add "JUnit Parser" task to allow browsing test results in Bamboo.

You can consider using tools like xmlstarlet to achieve this.

To fail a script task simply call "exit 1". Also, the script task and JUnit Parser task probably should be "final" tasks, to always run.

Cheers,
Marcin

Mark Hirota Sep 23, 2015

Hi Marcin, I'm looking for a feature like this: https://confluence.jetbrains.com/display/TCD9/Build+Failure+Conditions#BuildFailureConditions-Failbuildonmetricchange Is anything in the works like this?

Marcin Oles Atlassian Team Sep 23, 2015

I haven't heard of such a feature or a plugin that introduces it. However, this feature sounds pluggable, as Bamboo already has extendable post build processors. So maybe it's worth to look through Atlassian Marketplace for a plugin that does it? You can also create a feature request under https://jira.atlassian.com/browse/BAM.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

920 views 12 15
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