How can I make the build green, with quarantined test?

We just upgraded to Bamboo 4.2.1 and I have a build which runs a set of Junit tests. One of these tests is failing, so I quarantined it temporarily. I've re-run the build, but in the Dashboard view, it's still showing as red(failing) but the test column says 8 passed. It doesn't show any failures. How can I make the build show green, even with quarantined tests?

1 answer

1 accepted

This widget could not be displayed.

It should be green if the only failing test is quarantined ant the build has completed successfully. If it's still red, please open an issue at support.atlassian.com

I'm running the test with maven, and since it's failing in the build log, it's exiting with an error status. I suspect this is why the build is showing red.

I ended up finding a work around to my issue. In Bamboo, I use a mvn command to launch tests. I appended || true to the command, which resolves the build color issue.

Example:

mvn clean test [arguments] || true

I have a similar problem. Our build process does both the build and test in a single process. If there is a build or test failure, the process returns a non-zero return code. And so, even if I quarantine failing tests, the job is still recorded as a failure. However, if I added a "|| true", then that would pave over all errors, including build errors. That just flips the problem from good builds being marked as failed to bad builds being marked as successful.

Is there a standard or best practice on what a test running should return when there are test failures? One workaround that I can think of is that the build/test process returns a specific code on test failure that a Bamboo wrapper could then check for, return 0, and let the JUnit parser do its thing. Seems hacky to me.

Found this via searching; if anyone's tempted to go down the same path, I suggest doing a testless maven build, then doing a separate maven step that runs the tests which you can || with true.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

137 views 2 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you