Discussion:
[java code coverage] How to mark build as UNSTABLE with Jacoco Jenkins plugin when coverage drops
o***@gmail.com
2018-10-08 17:29:51 UTC
Permalink
I'm having troubles with configuring Jacoco Jenkins plugin.

There is a job which validates GitHub pull requests. This job is using Jacoco plugin for coverage reporting. The goal is to mark the build as Unstable if the coverage drops. I've set the health thresholds as this:
Change build status according to thresholds: CHECKED
SUNNY: Instructions=100%, Branch=100%, Complexity=100%, Line=100%, Method=100%, Class=100%

STORMY CLOUD: Instructions=91%, Branch=77%, Complexity=80%, Line=90%, Method=91%, Class=98%


I expected that with this configuration all builds with coverage above the min (stormy cloud) will be SUCCESSFUL, and all builds with coverage below the min will be UNSTABLE.

However, all builds with coverage between min and max are unstable now. For example, if the Instruction is 92 the build will become yellow even though the code quality has improved.

Could anyone advise me on how to properly configure this plugin for thresholds? There is not enough information on this online.


Thanks
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/4294a613-03a0-4c7a-96bf-e17e7fa8974d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Henrik Horneber
2018-10-08 17:57:32 UTC
Permalink
This is not the correct list to ask questions regarding the jenkins plugin
unfortunately.
Judging from its site here https://plugins.jenkins.io/jacoco the plugin is
maintained by the jenkins core team. So the jenkins mailing list might get
you answers.
Post by o***@gmail.com
I'm having troubles with configuring Jacoco Jenkins plugin.
There is a job which validates GitHub pull requests. This job is using
Jacoco plugin for coverage reporting. The goal is to mark the build as
Change build status according to thresholds: CHECKED
SUNNY: Instructions=100%, Branch=100%, Complexity=100%, Line=100%, Method=100%, Class=100%
STORMY CLOUD: Instructions=91%, Branch=77%, Complexity=80%, Line=90%, Method=91%, Class=98%
I expected that with this configuration all builds with coverage above the
min (stormy cloud) will be SUCCESSFUL, and all builds with coverage below
the min will be UNSTABLE.
However, all builds with coverage between min and max are unstable now.
For example, if the Instruction is 92 the build will become yellow even
though the code quality has improved.
Could anyone advise me on how to properly configure this plugin for
thresholds? There is not enough information on this online.
Thanks
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/4294a613-03a0-4c7a-96bf-e17e7fa8974d%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
"I find many of the machines of violence very attractive. Tanks, airplanes,
warships, especially aircraft carriers."
- 14th Dalai Lama
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAMCezdMH6j3pwsmAkuMmxefSdLKt7ez12B9eMY7UEM21w%2BKnDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Henrik Horneber
2018-10-08 17:59:14 UTC
Permalink
Or better this one methinks
http://groups.google.com/group/jenkins-jacoco-plugin-mailing-list
Post by Henrik Horneber
This is not the correct list to ask questions regarding the jenkins plugin
unfortunately.
Judging from its site here https://plugins.jenkins.io/jacoco the plugin
is maintained by the jenkins core team. So the jenkins mailing list might
get you answers.
Post by o***@gmail.com
I'm having troubles with configuring Jacoco Jenkins plugin.
There is a job which validates GitHub pull requests. This job is using
Jacoco plugin for coverage reporting. The goal is to mark the build as
Change build status according to thresholds: CHECKED
SUNNY: Instructions=100%, Branch=100%, Complexity=100%, Line=100%,
Method=100%, Class=100%
STORMY CLOUD: Instructions=91%, Branch=77%, Complexity=80%, Line=90%,
Method=91%, Class=98%
I expected that with this configuration all builds with coverage above
the min (stormy cloud) will be SUCCESSFUL, and all builds with coverage
below the min will be UNSTABLE.
However, all builds with coverage between min and max are unstable now.
For example, if the Instruction is 92 the build will become yellow even
though the code quality has improved.
Could anyone advise me on how to properly configure this plugin for
thresholds? There is not enough information on this online.
Thanks
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/4294a613-03a0-4c7a-96bf-e17e7fa8974d%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
"I find many of the machines of violence very attractive. Tanks,
airplanes, warships, especially aircraft carriers."
- 14th Dalai Lama
--
"I find many of the machines of violence very attractive. Tanks, airplanes,
warships, especially aircraft carriers."
- 14th Dalai Lama
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/CAMCezdMMBds66p8_mjvN%2BVhHctjfpsuctzJFK1xZ4uF5MJctHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Evgeny Mandrikov
2018-10-08 18:29:30 UTC
Permalink
Hi,

First thing first - as stated in JaCoCo documentation on page
https://www.jacoco.org/jacoco/trunk/doc/integrations.html : Jenkins
integration is third-party, not developed by JaCoCo team. So you'd
definitely better seek help in Jenkins community. More specifically - page
https://plugins.jenkins.io/jacoco points out to dedicated mailing list
http://groups.google.com/group/jenkins-jacoco-plugin-mailing-list as well
as to dedicated issue tracker
https://issues.jenkins-ci.org/browse/JENKINS/component/16541

Also AFAIK nowadays there are multiple Jenkins plugins supporting
thresholds - in addition to the old one mentioned above there is also new
one https://jenkins.io/projects/gsoc/2018/code-coverage-api-plugin/ that in
his turn has its own issue tracker at
https://github.com/jenkinsci/code-coverage-api-plugin/issues

Assuming that you're talking about first one: quick search in its issue
tracker reveals https://issues.jenkins-ci.org/browse/JENKINS-16903 and
https://groups.google.com/forum/#!topic/jenkins-jacoco-plugin-mailing-list/pzHm98RJjB8/discussion
according to which, as far as I can see, behaviour that you observe is
correct/expected one - above "sunny" is green, below "sunny" and "above
stormy cloud" is unstable, "below stormy cloud" is failure. Developers of
these plugins know better, but in my opinion this makes perfect sense - 2
thresholds with corresponding icons are needed to define 3 possible
outcomes, lowest possible outcome (failure) has no icon.

Hope this helps.


Regards,
Evgeny
Post by o***@gmail.com
I'm having troubles with configuring Jacoco Jenkins plugin.
There is a job which validates GitHub pull requests. This job is using
Jacoco plugin for coverage reporting. The goal is to mark the build as
Change build status according to thresholds: CHECKED
SUNNY: Instructions=100%, Branch=100%, Complexity=100%, Line=100%, Method=100%, Class=100%
STORMY CLOUD: Instructions=91%, Branch=77%, Complexity=80%, Line=90%, Method=91%, Class=98%
I expected that with this configuration all builds with coverage above the
min (stormy cloud) will be SUCCESSFUL, and all builds with coverage below
the min will be UNSTABLE.
However, all builds with coverage between min and max are unstable now.
For example, if the Instruction is 92 the build will become yellow even
though the code quality has improved.
Could anyone advise me on how to properly configure this plugin for
thresholds? There is not enough information on this online.
Thanks
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/9de19f16-eed0-49e0-bed2-3250e31b8ee5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...