-
Notifications
You must be signed in to change notification settings - Fork 18
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
Changed source paths/filenames in 8.8.173 in combination with reportgenerator #229
Comments
This change was intended as a resolution to issue #197, and also to bring the output into conformance with the original cobertura format, based as it is on the Java behaviour of keeping file path and full class name in step with one another. It should be extracting longest common leading paths - in this case it should be extracting |
The leading common path extraction is coverage-report wide; with multiple independent reports being consolidated, each would have its own local root path. |
Looks like there's an easy enough resolution - allow user specification one or more package roots like |
Should be resolved in v8.9.3 |
@SteveGilham - thanks again for fixing it such quickly - I just gave it a shot and that looks very good: the rport was generated with no error: Thanks Steve! |
Discussed in #228
Originally posted by kimpenhaus August 15, 2024
Good morning @SteveGilham,
sorry bothering you again :) We've noticed a change in the generated cobertura files from 8.8.74 to 8.8.173 in the way the source elements and the filenames are generated.
I don't see an issue in this per se but with our setup the changes breaks the coverage analysis. we have a multi-projekt/assembly setup in azure that generated the code coverage with altcover in cobertura format and uses reportgenerator to "transform" this into single file cobertura and sonarqube generic format.
When updating to the latest version we realised that the reportgenerator threw lots of file not found warnings. drilling this down leeds us to the changes done by the new altcover verion. I will try to explain further:
In 8.8.74 it seems thet all filenames were absolute and the sources seem to contain all directories
assembly 1 (sample):
assembly 2 (sample):
With the new 8.8.173 version same sources this seems to have changed in the way that sources contains the lowest common denominator (hopefully you understand what I mean with that :)) dircotryname and the filenames are relative to that:
assembly 1 (sample):
assembly 2 (sample):
the change itself looks conclusive and recduces the size of the generated files - so I don't see an issue here itself.
But when heading to reportgenerator we have the problem that the reportgenerator won't find these files.
What we tried is to set the
sourcedirs
parameter to/agent/_work/1/s/src
but that will only fix those that matches with that directory in the sources. In the given samples/StringExtensions.cs
would not be found as the filename is not relative to/agent/_work/1/s/src
.as the assemblies (and maybe future assemblies) might vary in what sources will contain we have no idea what to set in the
sourcedirs
to cover this in general.So our question is: Is there a way to have a root source directory which tells altcover to generate all sources and filename relative to that? So that we cann have
/agent/_work/1/s/src
in altcover and in reportgenerator?Thanks for any suggestion 🙏🏼
The text was updated successfully, but these errors were encountered: