[workflow] how to mark build as unstable inside jenkins workflow?

7,204 views
Skip to first unread message

Arek Skalski

unread,
Mar 2, 2015, 9:25:03 AM3/2/15
to jenkins...@googlegroups.com
I want to implement threshold for number of failed tests on my worklfow build. If there are some failures and the threshold is not exceeded I would like to mark my build as unstable. How can I do it inside workflow job?

Baptiste Mathus

unread,
Mar 2, 2015, 12:04:20 PM3/2/15
to jenkins...@googlegroups.com

Well I guess this depends basically on the test plugin, independently from workflow itself. If some plugin, say the junit one, doesn't support this then I think you just then put many sh steps to achieve this.

Might seem not so interesting compared to a typical script, but the difference is you then get suspendability and so on quite naturally.

HTH

Le 2 mars 2015 15:25, "Arek Skalski" <askal...@gmail.com> a écrit :
I want to implement threshold for number of failed tests on my worklfow build. If there are some failures and the threshold is not exceeded I would like to mark my build as unstable. How can I do it inside workflow job?

--
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/3a013e89-e7ab-482b-98c0-22388b59b285%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesse Glick

unread,
Mar 19, 2015, 11:25:35 AM3/19/15
to jenkins...@googlegroups.com, m...@batmat.net
On Monday, March 2, 2015 at 12:04:20 PM UTC-5, Baptiste Mathus wrote:

If some plugin, say the junit one, doesn't support this

I do not think it does. You can configure how test failures affect build health, but if there is ≥1 failure then the build becomes UNSTABLE.

https://issues.jenkins-ci.org/browse/JENKINS-26276 would give you more options. It needs some more design work.

Also as of WF 1.4 if you can somehow inspect the test results without actually using the JUnit plugin to report them, you can decide whether or not to

currentBuild.result = 'UNSTABLE'

Arek Skalski

unread,
Mar 20, 2015, 4:11:38 AM3/20/15
to jenkins...@googlegroups.com, m...@batmat.net
That is exactly what I was looking for. Thanks!
currentBuild.result = 'UNSTABLE'

Lenaic frank Tchokogoue nematchoua

unread,
Jan 31, 2017, 9:29:52 AM1/31/17
to Jenkins Users
have you find a solution ?
i am having the same problem, i implement threshold on a pluging write on java, and i want to mark build as unstable in certain case.
thks
Reply all
Reply to author
Forward
0 new messages