Groovy postbuild plugin: What does containLog check

598 views
Skip to first unread message

Andreas Tscharner

unread,
Sep 27, 2017, 10:44:47 AM9/27/17
to Jenkins Users
Hello World,
Instead of the textFinder I am using the Groovy postbuild plugin to check if some tests (hand written) failed. I try the following:

if (manager.logContains("FAILURES!")) {
  manager.buildUnstable()
}

That does not seem to work however. So my question: What text exactly does logContains check? It it the complete output I see on the console output or is it only part of that? Or did I just make a mistake in the logContains check?

TIA and best regards
    Andreas

--
Andreas Tscharner                             sterne...@gmail.com

Gordon's Law:
If you think you have the solution, the question was poorly phrased.

Slide

unread,
Sep 27, 2017, 11:06:39 AM9/27/17
to Jenkins Users

I believe the match is done line by line and is done using a regular expression, so you may need to play around with that.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ac57d57a-54e3-2c38-c415-729d31db6207%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Tscharner

unread,
Sep 28, 2017, 10:38:06 AM9/28/17
to jenkins...@googlegroups.com, Slide
Hello again,

On 27.09.2017 17:06, Slide wrote:
> I believe the match is done line by line and is done using a regular
> expression, so you may need to play around with that.
>

Thank you! Your are right. The following regex works:

if (manager.logContains("(.*)(FAILURES!)(.*)")) {
manager.buildUnstable()
}

Best regards
Reply all
Reply to author
Forward
0 new messages