Upload test coverage to Codecov#249
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds test coverage collection (Cobertura via coverlet collector) to the CI unit-test run and uploads it to Codecov on a best-effort basis, aligning coverage reporting with the repository’s existing reusable-workflow validation gate.
Changes:
- Collect Cobertura coverage during
dotnet testinvalidate-task.ymland upload it to Codecov without failing CI on upload errors. - Add
coverlet.collectorto the test project and centralize its version inDirectory.Packages.props. - Thread
CODECOV_TOKENthrough reusable-workflow callers so uploads can authenticate when the secret is configured.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| LanguageTagsTests/LanguageTagsTests.csproj | Adds coverlet.collector to enable --collect:"XPlat Code Coverage" output. |
| Directory.Packages.props | Centralizes coverlet.collector version (10.0.1). |
| .github/workflows/validate-task.yml | Collects coverage during unit tests and uploads reports to Codecov best-effort. |
| .github/workflows/test-pull-request.yml | Passes secrets to the reusable validation workflow so uploads can authenticate. |
| .github/workflows/publish-release.yml | Passes secrets to the reusable validation workflow so uploads can authenticate during release validation. |
Collect Cobertura coverage during unit tests and upload it best-effort to Codecov, mirroring the PlexCleaner pattern. The upload is report-only (fail_ci_if_error: false) so a Codecov hiccup or an absent token never fails the validation gate. Both validate-task callers now pass secrets: inherit so CODECOV_TOKEN reaches the unit-test job. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collect Cobertura coverage during unit tests and upload it best-effort to Codecov, mirroring the proven PlexCleaner pattern.
Changes
dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage, followed by acodecov/codecov-action@v7.0.0upload step. The upload is report-only (fail_ci_if_error: false), so a Codecov hiccup or an absent token never fails the validation gate.PackageReferencetoLanguageTagsTests.csproj(it was missing) plus thePackageVersion(10.0.1) inDirectory.Packages.props, matching the PlexCleaner form.validate-task.yml(test-pull-request.ymlandpublish-release.yml) now passsecrets: inheritsoCODECOV_TOKENreaches the unit-test job.Maintainer action required
CODECOV_TOKENmust be set as an Actions secret in the repo for uploads to authenticate. Until then the upload is a harmless no-op (report-only, non-failing).Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com