Jenkins coverage plugin in the "Coverage of all files" tab in the coverage report groups all files with the same name in single package into single row instead of showing each of them as separate row. When you hover over the filename it shows path to one of the files with that name. The number of total and covered lines looks like sum for all the files with that name.

          [JENKINS-73021] Coverage plugin groups files with same name

          Ulli Hafner added a comment - - edited

          How can you have a file with the same name in the same package?

          Which parser are you using? Do you have an example?

          Ulli Hafner added a comment - - edited How can you have a file with the same name in the same package? Which parser are you using? Do you have an example?

          Nax added a comment -

          It is a .net project, with structure similar to:

          /Project/FeatureOne/Validator.cs
          /Project/FeatureTwo/Validator.cs

          The namespace in each file with same name is different.

          The coverage data is generated using coverlet collector.

           

          Nax added a comment - It is a .net project, with structure similar to: /Project/FeatureOne/Validator.cs /Project/FeatureTwo/Validator.cs The namespace in each file with same name is different. The coverage data is generated using coverlet collector.  

          Ulli Hafner added a comment -

          That means you are using opencover parser?

          Somehow your report does not declare the correct structure or the parser does not read it. Do you have an example report? You can strip it down to the two classes that are merged.

          Ulli Hafner added a comment - That means you are using opencover parser? Somehow your report does not declare the correct structure or the parser does not read it. Do you have an example report? You can strip it down to the two classes that are merged.

          Nax added a comment -

          Sorry, misunderstood the question. I am using the COBERTURA parser.

          Nax added a comment - Sorry, misunderstood the question. I am using the COBERTURA parser.

          Nax added a comment - - edited

          This the part of the Cobertura report:

          <class name="Project.FeatureOne.Handler" filename="D:\Solution\Project\FeatureOne\Handler.cs" line-rate="1" branch-rate="1" complexity="2">
            <methods>
              ...
            </methods>
            <lines>
              ...
            </lines>
          </class&gt;
          <class name="Project.FeatureTwo.Handler" filename="D:\Solution\Project\FeatureTwo\Handler.cs" line-rate="1" branch-rate="1" complexity="2">
            <methods>
              ...
            </methods>
            <lines>
              ...
            </lines>
          </class&gt;

          Nax added a comment - - edited This the part of the Cobertura report: < class name= "Project.FeatureOne.Handler" filename= "D:\Solution\Project\FeatureOne\Handler.cs" line-rate= "1" branch-rate= "1" complexity= "2" >   <methods>     ...   </methods>   <lines>     ...   </lines> </ class& gt; < class name= "Project.FeatureTwo.Handler" filename= "D:\Solution\Project\FeatureTwo\Handler.cs" line-rate= "1" branch-rate= "1" complexity= "2" >   <methods>     ...   </methods>   <lines>     ...   </lines> </ class& gt;

          Nax added a comment -

          drulli, Is there any chance this gets ever looked into? No pressure, just need to make some decisions on our end as this issue makes the plugin a lot less useful for us (invalid numbers reported, false positives on quality gate thresholds).

          Nax added a comment - drulli , Is there any chance this gets ever looked into? No pressure, just need to make some decisions on our end as this issue makes the plugin a lot less useful for us (invalid numbers reported, false positives on quality gate thresholds).

          Ulli Hafner added a comment -

          Thanks for pinging, it seems that I forgot about this issue. After reading it again, I think it is a duplicate of one of the problems reported in JENKINS-73175 which I fixed in https://github.com/jenkinsci/coverage-model/pull/113/commits/c6e6915c5763a510ef6cf7bb91c769e994fd5ca6. Can you please check if the problem is fixed in https://github.com/jenkinsci/coverage-model/releases/tag/v0.44.0 and https://github.com/jenkinsci/coverage-plugin/releases/tag/v1.15.0?

          Ulli Hafner added a comment - Thanks for pinging, it seems that I forgot about this issue. After reading it again, I think it is a duplicate of one of the problems reported in JENKINS-73175 which I fixed in https://github.com/jenkinsci/coverage-model/pull/113/commits/c6e6915c5763a510ef6cf7bb91c769e994fd5ca6 . Can you please check if the problem is fixed in https://github.com/jenkinsci/coverage-model/releases/tag/v0.44.0 and https://github.com/jenkinsci/coverage-plugin/releases/tag/v1.15.0?

          Nax added a comment -

          Thanks! I will verify it but it will take some time before I get our build server upgraded. Will get back to you. Thanks for all the hard work!

          Nax added a comment - Thanks! I will verify it but it will take some time before I get our build server upgraded. Will get back to you. Thanks for all the hard work!

          Nax added a comment -

          Just to follow up, I was not able to confirm as CloudBees is not yet supporting the latest version of the plugin: https://docs.cloudbees.com/plugins/ci/coverage

          Nax added a comment - Just to follow up, I was not able to confirm as CloudBees is not yet supporting the latest version of the plugin: https://docs.cloudbees.com/plugins/ci/coverage

          Nax added a comment -

          Version 1.16.1 is now available in CloudBees. I was able to verify that the issue is now resolved. Once again thank you drulli!

          Nax added a comment - Version 1.16.1 is now available in CloudBees. I was able to verify that the issue is now resolved. Once again thank you drulli !

            drulli Ulli Hafner
            naxem25618 Nax
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: