-
Notifications
You must be signed in to change notification settings - Fork 263
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
New MSTest runner doesn' t integrate with coverlet #3189
Comments
The new testing platform upon which the MSTest runner is build has got different extensibility point and MSBuild integration. |
Thanks for the reply!
That works
That works but does not give the coverage output on the command line.
I think TRX is not useful for this scenario. |
Only the msbuild integration scenario of Coverlet shows information in console, usually ppl that are not using it are generating a report with tools like report generator https://github.com/danielpalme/ReportGenerator @fhnaseer @jakubch1 is there some plan to have the coverage output on console? |
I find the coverage output on the command line very useful. It works with the coverlet tool but as far as I understand you have to first run the tests with dotnet run to generate a dll. And then you can run the coverlet tool with that dll. This means that I can't run the tool with dotnet watch to always run the tests and output the current coverage. Even not if I make a msbuild task for that because msbuild doesn't work with dotnet watch. |
Console output is useful but doesn't scale for big projects, usually IDEs offers contextual report like Visual Studio as explained here https://devblogs.microsoft.com/visualstudio/code-coverage-features-in-visual-studio-enterprise/
Are you using the hot reload extension https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-extensions-hosting#hot-reload? |
Yes that doesn't scale for big projects but we use microservices and that fits better.
Not yet |
How does this work with running multiple test projects in a solution? Before using the MSTest Runner, which I'm trying with MSTest.Sdk, I would use I have struggled to find the "solution wide coverage" approach. I'd be happy with multiple files, one per project, in a central directory. Merging is trivial with tools like report generator (which ADO pipelines use). Edit Well, sometimes typing it out helps. It seems Also -- yes -- I definitely am misunderstanding pieces of this. I have found it very difficult to understand what works with what given some "active" documentation predates this new way of working. |
If you've a solution with all MSTest runner configuration( here you can find some sample: |
Closing as duplicate of the coverlet issue coverlet-coverage/coverlet#1715 |
@Evangelink this isn't a duplicate. In the referenced issue is no sentence about the missing coverage output which is the point of this bug issue. |
This is a duplicate because coverlet extension works only for VSTest leading to coverage not being produced. We need coverlet to implement an extension to the new platform or you need to update your command for it to work. |
Previously I used
dotnet test /p:CollectCoverage=true
withcoverlet.msbuild
to produce an coverage output on the command line like that:But with the new MS Test runner this isn't possible anymore. It would be nice that this feature is restored. Or if someone has an alternative that shows the coverage for each module.
The text was updated successfully, but these errors were encountered: