• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • clover-plugin
    • None

      The PHP coverage thingy cannot generate statistics for conditions. The job page shows them correctly as 0/0. The graph, however, shows a 100% coverage line. It should not draw a line for conditional coverage if the total number of conditions is 0.

          [JENKINS-8198] Ignore 0/0 Conditional in coverage graph

          sogabe added a comment -

          sogabe added a comment - fixed. https://github.com/jenkinsci/clover-plugin/commit/ddbf016c17933cba373903bb797f18172b422509

          The "PHP coverage thingy", which is called PHP_CodeCoverage btw., currently only supports line coverage. This is why its Clover XML reporter sets "conditionals" and "coveredconditionals" to 0. In the near future, Xdebug will provide statement coverage and branch coverage information. This will then be used by PHP_CodeCoverage to set "conditionals" and "coveredconditionals" properly.

          That being said, it seem that the patch mentioned above somehow makes the weather report think that something is wrong with condition coverage. It would be nice if someone could look into this. I will try to reproduce the issue and, if need be, open a separate ticket for this with more detailed information.

          sebastian_bergmann added a comment - The "PHP coverage thingy", which is called PHP_CodeCoverage btw., currently only supports line coverage. This is why its Clover XML reporter sets "conditionals" and "coveredconditionals" to 0. In the near future, Xdebug will provide statement coverage and branch coverage information. This will then be used by PHP_CodeCoverage to set "conditionals" and "coveredconditionals" properly. That being said, it seem that the patch mentioned above somehow makes the weather report think that something is wrong with condition coverage. It would be nice if someone could look into this. I will try to reproduce the issue and, if need be, open a separate ticket for this with more detailed information.

          arzala added a comment - - edited

          @sebastian, this issue works ok from clover plugin point of view. Since conditionals are always 0/0 now, we have to configure "conditionals" in Coverage Metric Targets as "-1" to show correct weather information on project's home page until we have proper values of conditionals in the future.

          arzala added a comment - - edited @sebastian, this issue works ok from clover plugin point of view. Since conditionals are always 0/0 now, we have to configure "conditionals" in Coverage Metric Targets as "-1" to show correct weather information on project's home page until we have proper values of conditionals in the future.

          http://jenkins-php.org/ now configures "conditionals" in Coverage Metric Targets as "-1" which is a good enough workaround.

          sebastian_bergmann added a comment - http://jenkins-php.org/ now configures "conditionals" in Coverage Metric Targets as "-1" which is a good enough workaround.

          arzala added a comment -

          Yes, but now we do not need this standard Clover plugin, as we have new "Clover php" plugin specially customized for PHP based projects.

          arzala added a comment - Yes, but now we do not need this standard Clover plugin, as we have new "Clover php" plugin specially customized for PHP based projects.

            sogabe sogabe
            nhb nhb
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: