Skip to content

Upload test coverage to Codecov#249

Merged
ptr727 merged 1 commit into
developfrom
feature/codecov
Jul 7, 2026
Merged

Upload test coverage to Codecov#249
ptr727 merged 1 commit into
developfrom
feature/codecov

Conversation

@ptr727

@ptr727 ptr727 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Collect Cobertura coverage during unit tests and upload it best-effort to Codecov, mirroring the proven PlexCleaner pattern.

Changes

  • validate-task.yml: the unit-test job now runs dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage, followed by a codecov/codecov-action@v7.0.0 upload step. The upload is report-only (fail_ci_if_error: false), so a Codecov hiccup or an absent token never fails the validation gate.
  • coverlet.collector: added the PackageReference to LanguageTagsTests.csproj (it was missing) plus the PackageVersion (10.0.1) in Directory.Packages.props, matching the PlexCleaner form.
  • secrets threading: both callers of validate-task.yml (test-pull-request.yml and publish-release.yml) now pass secrets: inherit so CODECOV_TOKEN reaches the unit-test job.

Maintainer action required

CODECOV_TOKEN must 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

Copilot AI review requested due to automatic review settings July 7, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 test in validate-task.yml and upload it to Codecov without failing CI on upload errors.
  • Add coverlet.collector to the test project and centralize its version in Directory.Packages.props.
  • Thread CODECOV_TOKEN through 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.

Comment thread .github/workflows/validate-task.yml
Comment thread .github/workflows/test-pull-request.yml
Comment thread .github/workflows/publish-release.yml
Comment thread LanguageTagsTests/LanguageTagsTests.csproj
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>
@ptr727 ptr727 force-pushed the feature/codecov branch from c29ddfc to 8d44d2c Compare July 7, 2026 16:07
@ptr727 ptr727 merged commit 0f2001b into develop Jul 7, 2026
10 checks passed
@ptr727 ptr727 deleted the feature/codecov branch July 7, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants