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

[BUG] coverlet does not support multiple report formats using CoverletOutput parameter #1610

Open
Bertk opened this issue Feb 7, 2024 · 4 comments
Labels

Comments

@Bertk
Copy link
Collaborator

Bertk commented Feb 7, 2024

Describe the bug
coverlet.msbuild.tasks overrides code coverage result file using file name of given CoverletOutput parameter.

To Reproduce

execute command:
dotnet test test\coverlet.core.tests\coverlet.core.tests.csproj --configuration debug /p:CollectCoverage=true /p:CoverletOutputFormat="json%2copencover" /p:CoverletOutput="C:\GitHub\coverlet\artifacts\Reports\coverlet.core\coverage.json" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*%2c[coverlet.tests.projectsample]*%2c[testgen_]*" --results-directory:"C:\GitHub\coverlet\artifacts\Reports\coverlet.core" --diag:"C:\GitHub\coverlet\artifacts\log\debug\coverlet.core.test.diag.log;tracelevel=diag"

Expected behavior
2 code coverage result files are available (formats: json, opencover)

Actual behavior
Only one code coverage result file is available.
image

Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? 6.0.1-preview.39.g9321d2e2cc
* Which version of .NET is the code running on? net8.0
* What OS and version, and what distro if applicable? windows 11
* What is the architecture (x64, x86, ARM, ARM64)? x64

Additional context
none

@Bertk Bertk added the bug Something isn't working label Feb 7, 2024
@github-actions github-actions bot added the untriaged To be investigated label Feb 7, 2024
@Bertk
Copy link
Collaborator Author

Bertk commented Feb 7, 2024

@Bertk Bertk added as-designed Expected behaviour and removed untriaged To be investigated labels Feb 7, 2024
@Bertk
Copy link
Collaborator Author

Bertk commented Feb 7, 2024

Filename for multiple report formats is currently not supported.
CoverletOutput parameter without file shall be used instead e.g. /p:CoverletOutput="C:/GitHub/coverlet/artifacts/Reports/coverlet.core/"

image

@Bertk Bertk removed the bug Something isn't working label Feb 7, 2024
@Bertk Bertk self-assigned this Feb 7, 2024
@Bertk Bertk closed this as completed Feb 11, 2024
@daveMueller
Copy link
Collaborator

daveMueller commented Feb 11, 2024

I've seen that we have the same issue for coverlet.console. The idea to just use the output directory in those cases sounds good to me. We can also create a new issue for this.

grafik

@Bertk
Copy link
Collaborator Author

Bertk commented Feb 12, 2024

Update of GlobalTool.md should be sufficient e.g.

whenever more than one coverage format is used in combination with output parameter only a folder shall be used

current paragraph

The above command will write the results to the supplied path, if no file extension is specified it'll use the standard extension of the selected output format. To specify a directory instead, simply append a / to the end of the value.

coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --output "/custom/directory/" -f json -f lcov

@Bertk Bertk reopened this Feb 12, 2024
@github-actions github-actions bot added the untriaged To be investigated label Feb 12, 2024
@Bertk Bertk added documentation and removed untriaged To be investigated labels Feb 12, 2024
@Bertk Bertk removed their assignment Feb 12, 2024
@Bertk Bertk changed the title [BUG] coverlet.msbuild.tasks does not support multiple report formats using CoverletOutput parameter [BUG] coverlet does not support multiple report formats using CoverletOutput parameter Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants