Mark individual step as failure
When investigating a problem it is usually more important to know
which individual step failed, than knowing the difference between
"tests failing" and "failed to build". Therefore use Jenkins "error"
command instead of marking the whole pipeline as "UNSTABLE".
@@ -127,8 +127,7 @@ class BazelUtils implements Serializable {
def status = bazelCommand("test ${filteredTests.replaceAll("\n", " ")}", true)
if (status == 3) {
// Bazel returns 3 if there was a test failures but no breakage, that is unstable
- script.currentBuild.result = "UNSTABLE"
- script.echo("`bazel test` returned status 3 which indicates test failures")
+ script.error("`bazel test` returned status 3 which indicates test failures")
} else if (status != 0) {
// TODO(dmarting): capturing the output mark the wrong step at failure, there is
// no good way to do so, it would probably better to have better output in the failing
