How to count maven pass tests count, failed test count etc.

53 views
Skip to first unread message

foolhunger Hsiao

unread,
Jan 5, 2016, 12:31:36 AM1/5/16
to Jenkins Users

Hi, all

 

We encountered a situation where we want only to deploy maven build artifacts if the UT pass rate is above 80%.

 

In order to do that, we need to get the all UT count, UT pass count, UT failed count etc. (if UT failed > 80% of UT all, skip the deploy)

 

Since we need to get this information during the build process, is writing a plugin the only option?

 

If so, are there any recommended resources.

Thanks

Victor Martinez

unread,
Jan 5, 2016, 2:29:15 AM1/5/16
to Jenkins Users
Hi,

 Off the top of my head I'll suggest the two below options:

1) Groovy Post Build and Promoted Plugin, so run your maven test command as usual, then a post build action will evaluate the UT rate and threshold and in that case it will change the status of the build as stable/unstable, the Promoted Plugin will trigger a maven deploy action only when the build is stable and will reuse the same slave/workspace.

2) Conditional build steps, so you can add some validations during the build, but I haven't used that one much

3) Create your own maven plugin in order to fail a build when the UT rate is lower than X%  

My two cents

Baptiste Mathus

unread,
Jan 5, 2016, 3:04:54 AM1/5/16
to jenkins...@googlegroups.com

Seems like a potential candidate for workflow job too.

--
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/73aa6e81-8a97-46d2-9c4d-71aca722e5cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages