Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

"publish Junit report" step - how does the "Step Failure Condition" work? #4301

OnQuickBuild ·

Hello Robin

Could you help me with this one please? I'm trying to control the overall test results, many parallel steps run similar tests and will all publish JUnit report eventually. But the "Step Failure Condition" only has two options:

current.errors + current.failures > 0

and

false

It looks like script format but I'm not sure if it accepts and parses more complicated Groovy scripts.
What input does this setting expect? For example, using Groovy, how to recreate the "false" input, just return "false"?

And what about the other condition? Return "current.errors + current.failures > 0" which might be true?

Thank you

  • replies 1
  • views 1683
  • stars 0
steveluo ADMIN ·

Hi@OnQuickBuild

It looks like script format but I'm not sure if it accepts and parses more complicated Groovy scripts.

Yes, it supports Groovy scripts.

What input does this setting expect? For example, using Groovy, how to recreate the "false" input, just return "false"?

The field expects a boolean result. If you want to return "false", you can just write "false", or for example:

if (current.errors + current.failures > 0)
  return true;
else
  return false;

And what about the other condition? Return "current.errors + current.failures > 0" which might be true?

What do you mean other condition? When there is no errors or failures, then expression current.errors + current.failures > 0 will be true.

Generally speaking, below are used often:

  • current.errors - errors found in JUnit report
  • current.failures - failures found in JUnit report
  • current.tests - total tests found in JUnit report
  • current.skipped - skipped tests found in JUnit report