Skip to content

Instantly share code, notes, and snippets.

@jparrill
Created July 9, 2013 10:23
Show Gist options
  • Save jparrill/5956311 to your computer and use it in GitHub Desktop.
Save jparrill/5956311 to your computer and use it in GitHub Desktop.
SoapUI Test failed detector in groovy for Jenkins
pattern = /.*Total TestCases: ([0-9]) \(([0-9]) failed\)*./
matcher = manager.getLogMatcher(pattern)
if(matcher?.matches()) {
total = matcher.group(1).toInteger()
fails = matcher.group(2).toInteger()
}
manager.listener.logger.println total
manager.listener.logger.println fails
if(fails > 0) {
manager.buildUnstable()
if(fails == total) {
manager.buildFailure()
}
} else {
manager.buildSuccess()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment