Repository navigation
Closed
Labels
bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviorexternal ⤴️Something related to or caused by an external projectSomething related to or caused by an external projectmvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkitnext preview ✈️This changes will be available in the upcoming previewThis changes will be available in the upcoming preview
Description
Describe the bug
With a module containing code generated by the MVVM Toolkit coverage information from Coverlet will not be created.
Regression
No response
Steps to reproduce
1. Create a project using the MVVM toolkit
2. Add a class which uses features from the toolkit & generates code
3. Run dotnet test /p:CollectCoverage=true
4. Observe that modules without MVVM toolkit have coverage & those with do not
Expected behavior
Expect to observe coverage information of all modules with tests.
Screenshots
No response
IDE and version
VS 2022
IDE version
17.1.3
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.0.0-preview3
Additional context
Example repo with action running test here:
https://github.com/will-jj/MVVM-Coverage
Coverlet log information here:
[coverlet] Unable to instrument module: C:\x\CoverageIssue\CoverageIssue.Tests\bin\Debug\net6.0-windows\CoverageIssue.dll, pdb without local source files, [C:\x\CoverageIssue\CoverageIssue\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator\CoverageIssue.ViewModelUsesObservableProperty.cs]
Help us help you
No, just wanted to report this
Metadata
Metadata
Assignees
Labels
bug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviorexternal ⤴️Something related to or caused by an external projectSomething related to or caused by an external projectmvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkitnext preview ✈️This changes will be available in the upcoming previewThis changes will be available in the upcoming preview
Activity
Sergio0694 commentedon May 27, 2022
Hey @will-jj, did you open an issue about this in the Coverlet repo? If so we should reference it here too.
Also if they confirm this is just an issue with that library we can close this. Thanks! 🙂
will-jj commentedon May 30, 2022
Hi @Sergio0694, they have got back to me and without too much repetition: it is a known issue coverlet-coverage/coverlet#1164
The proposed solution would be to suffix the generated files with
.g.csrather than.csSergio0694 commentedon May 30, 2022
Thank you for linking that issue. I do believe this is technically external, but no harm in using ".g.cs" ourselves too 🙂
will-jj commentedon May 30, 2022
Thanks very much for making the change, I've updated my repo with the build from the PR & it is now providing coverage results.