Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43902

Clover plugin stopped modifying build status

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: clover-plugin
    • Labels:
    • Environment:
      Jenkins 2.46.2
      Clover plugin 4.7.1
    • Similar Issues:

      Description

      We are using clover plugin to change the build status according to code coverage. Yesterday, Clover plugin stopped modifying the build status. Even though coverage is under user-defined unhealthy limits, build started to have a SUCCESS build result instead of UNSTABLE a few hours ago. The clover.xml report is still there and the HTML report is still published but build status isn't set to UNSTABLE anymore. No update and not change to the Jenkinsfile was done.

       

      Pipeline output displays:

      [Pipeline] stepPublishing Clover coverage report...
       Publishing Clover HTML report...
       Publishing Clover XML report...
       Publishing Clover coverage results...

      It used to display:

      [Pipeline] stepPublishing Clover coverage report...
       Publishing Clover HTML report...
       Publishing Clover XML report...
       Publishing Clover coverage results...
       Code coverage enforcement failed for the following metrics:
       Conditionals
       Setting Build to unstable.

        Attachments

          Activity

          Hide
          marekparf Marek Parfianowicz added a comment - - edited

          Do you have any debug logs for this?

          Do you have the failingTarget set for Clover? I'm asking because the code looks like this:

          final Set<CoverageMetric> failingMetrics = failingTarget != null
                              ? failingTarget.getFailingMetrics(result)
                              : Collections.<CoverageMetric>emptySet();
                      if (!failingMetrics.isEmpty()) {
                          listener.getLogger().println("Code coverage enforcement failed for the following metrics:");
                          // ...
                          listener.getLogger().println("Setting Build to unstable.");
                          build.setResult(Result.UNSTABLE);
                      }
          

          So as you can see if you have no failingTarget property set in your pipeline config, it will not report any unstable build.

          Show
          marekparf Marek Parfianowicz added a comment - - edited Do you have any debug logs for this? Do you have the failingTarget set for Clover? I'm asking because the code looks like this: final Set<CoverageMetric> failingMetrics = failingTarget != null ? failingTarget.getFailingMetrics(result) : Collections.<CoverageMetric>emptySet(); if (!failingMetrics.isEmpty()) { listener.getLogger().println( "Code coverage enforcement failed for the following metrics:" ); // ... listener.getLogger().println( "Setting Build to unstable." ); build.setResult(Result.UNSTABLE); } So as you can see if you have no failingTarget property set in your pipeline config, it will not report any unstable build.
          Hide
          karin_endouble Karin van den Berg added a comment - - edited

          I came here due to the same problem. What is the point of the unhealthyTarget if it has no effect on the build status? The Clover PHP plugin behaves differently. 

          I can't seem to find any info on what the three targets are supposed to do, and it seems like there are only two possible outcomes : success or unstable. You'd only need one target for that, it's either above or below the target. 

          Show
          karin_endouble Karin van den Berg added a comment - - edited I came here due to the same problem. What is the point of the unhealthyTarget if it has no effect on the build status? The Clover PHP plugin behaves differently.  I can't seem to find any info on what the three targets are supposed to do, and it seems like there are only two possible outcomes : success or unstable. You'd only need one target for that, it's either above or below the target. 
          Hide
          marekparf Marek Parfianowicz added a comment -

          Could you please elaborate more? If I understand the problem correctly, this is not a bug, but a different expectation on how the plugin shall behave. As I showed in the code snippet, the build can be marked as unstable if the 'failing target' parameter is set in configuration. My recommendation is to close this bug as "answered" or "invalid".

          Show
          marekparf Marek Parfianowicz added a comment - Could you please elaborate more? If I understand the problem correctly, this is not a bug, but a different expectation on how the plugin shall behave. As I showed in the code snippet, the build can be marked as unstable if the 'failing target' parameter is set in configuration. My recommendation is to close this bug as "answered" or "invalid".

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            christophehenry christophe henry
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: