formulahendry / formulahendry/vscode-dotnet-test-explorer

Using runsettings file in testArguments causes duplicate results/coverage to be collected

Open
#392 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
208
Forks
93
PR merge metrics
No merged PRs in 30d

Description

I have a simple `.runsettings` file in the root of my repo which just collects coverage:
```xml





lcov



```
When I run `dotnet test`, I provide the path to the settings file, and it generates the coverage in a single folder:
```sh
dotnet test --settings .runsettings
```
![image](https://github.com/formulahendry/vscode-dotnet-test-explorer/assets/58235000/3b96ebd7-f412-4d04-874f-469d56d1168c)

However when I set the `dotnet-test-explorer.testArguments` setting to `"--settings .runsettings"` and run the same tests, it generates _two_ folders; one similar to before, and another which is named after the host machine name (in this example, **zebra** is my computer name).
![image](https://github.com/formulahendry/vscode-dotnet-test-explorer/assets/58235000/06829655-adc3-41e7-9672-7e3ab8985518)

Both `coverage.info` files in the second example contain the exact same data.

Why is this extension collecting the same test results twice when the underlying `dotnet test` command does not, and how can I suppress the duplicate test results?

#### Notes:

I have tried using the format suggested on the readme, `"--settings:./.runsettings"`, however it produces the same results.

I know that I can use `/p` parameters instead to collect coverage as suggested in the readme (`/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=../../lcov.info`), and this works nicely, however I need to use the runsettings as part of my workflow. As such, I'd rather avoid having two separate configurations, and have everything just reading from the runsettings file.

#### Debug info:

1. Dotnet sdk version: `8.0.100`
2. Unit test framework and relevants versions of that: `xunit 2.4.2`
3. A link to a repo that replicated the issue: Can create one if required
4. OS: Linux Mint 21.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.