Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Inconsistent paths in cobertura reports #1723

Open
rivnakm opened this issue Dec 29, 2024 · 0 comments
Open

[BUG] Inconsistent paths in cobertura reports #1723

rivnakm opened this issue Dec 29, 2024 · 0 comments
Labels
untriaged To be investigated

Comments

@rivnakm
Copy link

rivnakm commented Dec 29, 2024

Describe the bug

When producing coverage reports in cobertura format, the way the path is split between the <source> tag and the filename attribute on class tags is inconsistent across test projects. Sometimes the source tag is the path to the project directory, sometimes it's my home directory, and sometimes it's my root directory. Combining the two parts of the path is always correct, but the way they are split is inconsistent.

Other report formats don't split the path like cobertura, so the issue is not present there.

To Reproduce
Generate coverage reports for a solution with multiple test projects, using the cobertura format, with source link disabled.

Expected behavior
I'm not sure exactly what the expected root should be, I would expect it to be the test project directory, with class files being relative to that. Overall it should be consistent across projects.

Actual behavior
Coverage source directories are inconsistent between multiple test projects within the same solution.

  <sources>
    <source>/home/michael/Code/anna/Anna.Index/</source>
  </sources>
  <packages>
    <package name="Anna.Index" line-rate="0.9764" branch-rate="1" complexity="39">
      <classes>
        <class name="Anna.Index.PackageIndex" filename="PackageIndex.cs" line-rate="1" branch-rate="1" complexity="1">
  <sources>
    <source>/</source>
  </sources>
  <packages>
    <package name="Anna.Storage" line-rate="0.9823999999999999" branch-rate="1" complexity="16">
      <classes>
        <class name="Anna.Storage.PackageStorage" filename="home/michael/Code/anna/Anna.Storage/PackageStorage.cs" line-rate="0.9761" branch-rate="1" complexity="12">

Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used?
* Which version of .NET is the code running on?
* What OS and version, and what distro if applicable?
* What is the architecture (x64, x86, ARM, ARM64)?
* Do you know whether it is specific to that configuration?

Coverlet: v6.0.2
.NET 8.0 (8.0.111)
OS: Fedora Linux 41 x64

The same behavior is observed in my ubuntu github actions runners.

Additional context
Add any other context about the problem here.

❗ Please also read Known Issues

@github-actions github-actions bot added the untriaged To be investigated label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged To be investigated
Projects
None yet
Development

No branches or pull requests

1 participant