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

Clover plugin stopped modifying build status

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • clover-plugin
    • Jenkins 2.46.2
      Clover plugin 4.7.1

    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

          christophehenry christophe henry created issue -
          christophehenry christophe henry made changes -
          Field Original Value New Value
          Environment Jenkins 2 Jenkins 2.46.2
          Clover plugin 4.7.1
          christophehenry christophe henry made changes -
          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:
          {color:#9a9999}[Pipeline] step{color}Publishing Clover coverage report...
          Publishing Clover HTML report...
          Publishing Clover XML report...
          Publishing Clover coverage results...
          It used to display:
          {color:#9a9999}[Pipeline] step{color}Publishing 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.
          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:
          {noformat}
          [Pipeline] stepPublishing Clover coverage report...
           Publishing Clover HTML report...
           Publishing Clover XML report...
           Publishing Clover coverage results...{noformat}

           It used to display:
          {noformat}
          [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.{noformat}
          stephenconnolly Stephen Connolly made changes -
          Assignee Stephen Connolly [ stephenconnolly ]
          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.

          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.
          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. 

          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. 

          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".

          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

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

            Dates

              Created:
              Updated: