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

0 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,580 views 0 6
Read article

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