Predictable folder - single code coverage file
When using the coverage gutters vscode extension, coverage results do not update properly while running dotnet watch test. I assume this is the case since the tool does not know which random folder has the latest results to display. And if it tries to merge them, it may not understand the proper order?
I read the following but it would be great to be able to override this design setting to create a single file that is overwritten while I dotnet watch test --collect...
NB: By design VSTest platform will create your file under a random named folder(guid string) so if you need stable path to load file to some gui report system(i.e. coveralls, codecov, reportgenerator etc..) that doesn't support glob patterns or hierarchical search, you'll need to manually move resulting file to a predictable folder.
👻
Hi,
please try coverlet.msbuild which does not use vstest result folder.
Alternative:
- use msbuild target after test and copy coverage results to project unit folder
- use msbuild target before test execution and delete folders in „TestResults“ folder
https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-targets?view=vs-2022#sdk-and-default-build-targets
Ok. I'll check out that package. I think that is what I'm using already though.
The build targets seem like a lift for a basic feature. A cli flag would be preferred no?
Please note: This is not a coverlet issue but related to VS code tooling. I use dotnet CLI for build and test.
The dotnet example is using coverlet.msbuild but you use "dotnet watch test --collect..." which requires coverlet.collector.
The MSBuild target might not be necessary but allows to relocate build result easily. https://learn.microsoft.com/en-us/visualstudio/msbuild/copy-task?view=vs-2022
This issue is stale because it has been open for 3 months with no activity.
This issue is stale because it has been open for 3 months with no activity.