-
Notifications
You must be signed in to change notification settings - Fork 388
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
Fix CoverletSourceRootsMapping path #863
Fix CoverletSourceRootsMapping path #863
Conversation
Fix the path for the CoverletSourceRootsMapping file not being set correctly if the OutputPath property does not end with a trailing directory separator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank's Martin!
Seems ok to me, @clairernovotny can you double check if there is a better way or if it's ok as is(you're more expert than me on msbuild)?
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
You probably want |
Ah yes, I’d forgotten about that one. Will update the PR a bit later. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank's to all
Use EnsureTrailingSlash() instead of Path.Combine(). Co-Authored-By: Claire Novotny <[email protected]>
@martincostello you can try nigthly https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md tomorrow(published ~00.00) Let me know! Thank's again to all! |
Remove workaround for coverage not working for deterministic builds and pick up changes from coverlet-coverage/coverlet#863.
@MarcoRossignoli I've pulled the nightly into this PR here and it's working as expected without my workaround for the incorrect path: martincostello/xunit-logging#139 However, I still need to use the Without: https://github.com/martincostello/xunit-logging/pull/139/checks?check_run_id=741352608#step:4:151 With: https://github.com/martincostello/xunit-logging/pull/139/checks?check_run_id=741370987#step:4:154 |
Interesting, I don't know what changes were done on that side, but we can keep the "fix"...btw in future version of sdk we can avoid target workaround dotnet/roslyn#43706 (comment) |
I guess the fix that will make the extra target redundant will come in a future version of 3.1.3xx as it seems to have missed 3.1.300 |
@tmat maybe can answer, but I think that will come since next release as servicing dotnet/roslyn#43476 (comment) |
The target update missed the 3.1.300 and Coverlet needs an update to call the updated target as well. There are two options for Coverlet: always call the target and fail not do the path mapping if it hasn't been updated (basically require the SDK that has the fix as a minimum), or conditionally call that target and also support the workaround target for lower SDK's. |
Adding a package reference in a non-test project would lead to this error when running `dotnet test` in the repository root: > ~/.nuget/packages/coverlet.msbuild/3.0.3/build/coverlet.msbuild.targets(70,5): error MSB4044: The "Coverlet.MSbuild.Tasks.CoverageResultTask" task was not given a value for the required parameter "InstrumenterState". See coverlet-coverage/coverlet#480 (comment) Also delete the workaround for the bug in generation of _LocalTopLevelSourceRoot which is [no longer necessary](coverlet-coverage/coverlet#863).
Fix the path for the
CoverletSourceRootsMapping
file not being set correctly if the$(OutputPath)
property does not end with a trailing directory separator.I was trying to enable deterministic builds using version 2.9.0 of the MSBuild package, but the code coverage wasn't being reported. I then noticed that the file was being created with the name
artifactsCoverletSourceRootsMapping
in my solution root, rather than asCoverletSourceRootsMapping
in theartifacts
directory.