coverlet.msbuild 6.0.4 does not generate coverage report when any test fails #1932
Unanswered
sharpzilla
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Description
When running tests with coverlet.msbuild 6.0.4, the coverage report (coverage.cobertura.xml) is not generated if at least one test fails. This occurs even when tests have run partially and coverage data should theoretically be available.
We need this to work in our GitLab CI pipeline — we want to display code coverage even for failed test runs.
Environment:
Steps to Reproduce
Have a test project using the packages above with coverlet.msbuild 6.0.4 installed.
Run the following command (ensure at least one test fails):
Check the TestResults/ folder.
Actual Behavior
Expected Behavior
The coverage report should be generated regardless of test pass/fail status. In CI pipelines (especially GitLab), we need to see coverage metrics even when some tests are failing — e.g., to track regressions or understand which parts of the code were executed.
Additional Context
We are aware of /p:Threshold which fails the build on low coverage — that is not our issue. We do not want to fail the build due to low coverage; we just want the coverage file to be saved even when tests fail.
It seems Coverlet currently assumes: "If any test fails, the coverage data is invalid and should not be saved" — but for CI visibility, this is too strict.
Beta Was this translation helpful? Give feedback.
All reactions