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

Coverlet.collector is impossible to use for mixed C++ / C# projects #1703

Closed
ClancyWalters opened this issue Sep 19, 2024 · 3 comments
Closed
Labels
documentation question This issue is a question Solved The issue is solved and can be closed

Comments

@ClancyWalters
Copy link

We use MSBuild.exe and vstest.console.exe rather than the dotnet cli due to incompatibility with mixed C++ / C# projects. The trouble is, both suggested uses of coverlet.collector require either dotnet test or dotnet publish. Ideally coverlet.collector should have a method of triggering the deployment that isn't via the dotnet cli tool unless there is some inherent incompatibility with mixed C++ / C# projects.

@github-actions github-actions bot added the untriaged To be investigated label Sep 19, 2024
@Bertk
Copy link
Collaborator

Bertk commented Sep 20, 2024

Did you try dotnet vstest already? The build output is created before the test will be started.

"C:\hostedtoolcache\windows\dotnet\dotnet.exe" vstest "D:\a\1\s\artifacts\bin\DotNetDev.ArcadeLight.Sdk.Tests\Debug\net8.0\DotNetDev.ArcadeLight.Sdk.Tests.dll" /collect:"XPlat Code Coverage" --ResultsDirectory:"D:\a\1\s\artifacts\TestResults\Debug" --logger:"trx
LogFileName=DotNetDev.ArcadeLight.Sdk.Tests_net8.0_x64.trx" --Diag:"D:\a\1\s\artifacts\log\Debug\DotNetDev.ArcadeLight.Sdk.Tests_net8.0_x64.diag.log
tracelevel=verbose" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile="**/*.Version.cs" > "D:\a\1\s\artifacts\log\Debug\DotNetDev.ArcadeLight.Sdk.Tests_net8.0_x64.log" 2>&1

@Bertk Bertk added question This issue is a question and removed untriaged To be investigated labels Sep 20, 2024
@ClancyWalters
Copy link
Author

Hey I've finished deep diving into getting this working now, dotnet vstest has the same problem as vstest.console.exe where we really need to run a dotnet publish first. The solution to my problem was realizing that you can run MSBuild.exe with the arguments /p:DebugType=portable /p:PublishProfile=<profile name> /t:Publish in order to get an output that includes the required coverlet files. This really isn't a problem with coverlet but perhaps is an opportunity to improve documentation.

@Bertk
Copy link
Collaborator

Bertk commented Sep 23, 2024

Great. You solved the problem already and this issue is obsolete.

We have already a section in Known Issues which mentions the DebugType setting.

Unfortunately, you did not use the default issue template which requests more details for troubleshooting.

@Bertk Bertk added documentation Solved The issue is solved and can be closed labels Sep 23, 2024
@Bertk Bertk closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation question This issue is a question Solved The issue is solved and can be closed
Projects
None yet
Development

No branches or pull requests

2 participants