-
Notifications
You must be signed in to change notification settings - Fork 386
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
File path issue with ProjectReference + SourceLink #951
Comments
I was able to get past this issue by setting I don't know that I care if the code coverage report shows a local path on the build server or the SourceLink path, so long as files don't show up twice. I am interested in hearing if there's a way that it should work or if there's something I could/should be doing differently in this space, thanks |
Thank's for reporting this. Do you get this issue only on .NET Framework?No issues on .NET Core? |
That's correct - on that branch of that repo, most tests run for I made a repro that was failing the same way but I must have made some inadvertent change and now it all seems to be working and showing the sourcelink paths no matter what I do This is how I've been running the tests and generating a report from the results:
|
It turns out my workaround isn't a real solution as now nuget.org won't validate the symbols package, so I'm back to trying to figure this out again. Here are the steps to see the issue in the Steeltoe codebase: git clone https://github.com/SteeltoeOSS/Steeltoe.git
cd Steeltoe
git checkout coverage
dotnet build .\src\Common\Common.sln -c Release /p:TF_BUILD=true
dotnet test .\src\Common\Common.sln --no-build -c Release --settings coverlet.runsettings --logger trx --results-directory C:\temp\testresults /p:TF_BUILD=true
# and then optionally
reportgenerator -reports:c:\temp\testresults\**\coverage.opencover.xml -targetdir:c:\temp\testresults\CodeCoverage -reporttypes:"HtmlInline_AzurePipelines;Cobertura" -plugins: -assemblyfilters:+* -classfilters:+* -filefilters:+* -verbosity:Info I was pretty sure the issue only happened with |
Here are some logs in case they can help |
Couple thoughts:
|
@clairernovotny thanks for the response
To restate the problem, the code coverage reports for tests on projects that include a projectreference are reporting a local path for the ProjectReference'd files , where the library being directly tested will use sourcelink paths... Please review the attached file and note the difference between the paths for files under Steeltoe.Common vs Steeltoe.Common.Net |
Coverlet should be getting the map for each project reference here to generate a multi map of project reference to local location: coverlet/src/coverlet.collector/build/netstandard1.0/coverlet.collector.targets Lines 25 to 32 in 8cf2b3c
Is there a |
I don't see one |
I was looking in the wrong output and search failed me... found one |
OK, so I found something else weird.. This looks like it's happening in test runs for Steeltoe.Common.Net, but not Steeltoe.Common.Http. These both target netstandard2.0, have tests running the same target frameworks and both depend on the same base library... I have no idea what could be different between the two that would cause this behavior to be different Here are my latest |
@clairernovotny do you have any time to look into this, or a direction to point me in to help get this figured out? I have another release I need to ship soon and I need this resolved somehow first |
The coverlet team is going to need to look into it. In the interim, what I did when coverlet had issues with deterministic builds was to do the build/pack first, then run the build/dotnet test command with /p:ContinuousIntegrationBuild=false to make it build with local paths for the tests. |
Sorry @TimHess for the delay and thanks a lot @clairernovotny for the help 🙇 @TimHess can you confirm that this is a way to repro #951 (comment) ? I'll take a look this week |
No problem @MarcoRossignoli - yes, the steps above are consistently reproducing the problem for me |
Did some investigation and you're suffering of 3 different issue:
At the end it works with collectors compiled for Now as temporary solution you can try my |
related issue #705 (comment) |
Thanks for digging in @MarcoRossignoli!
|
We merged today so will be in next coverlet release #970 For now try with custom build on unofficial and let me know. |
Ah, the tooling wasn't respecting the change I made the config file (so it wasn't actually looking at that feed when it should have been), that's why I couldn't find that version, sorry about that confusion. The custom build works, and we'll likely include the DiagnosticSource update in our next version, Thank you very much! |
Glad to hear that 🤗! |
Hello,
We're using coverlet in our project and we've been experiencing one of the known issues with the msbuild integration, so I'm working on switching to collectors in this PR. Almost everything is working correctly now, except that when tests run with a .NET Framework target and project references are involved, the path for files in the referenced project shows up as the local path instead of the sourcelink path like this.
Steeltoe is a pretty large set of packages and interconnected pieces, I can provide some more specific details if that will help but first I wanted to check if this is more likely to be an issue here or with SourceLink
The text was updated successfully, but these errors were encountered: