Skip to content

OPS-157454: Upload test coverage to Codacy from CI - #54

Merged
davidnmbond merged 1 commit into
mainfrom
ci/codacy-coverage
Sep 27, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
ci/codacy-coverage

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

What

Adds a coverage job to CI, on the same push and pull_request triggers as the build and on the pdl-public runner (never a GitHub-hosted one). It builds the test project, runs the Microsoft.Testing.Platform test executable with --coverage (Microsoft.Testing.Extensions.CodeCoverage, settings in coverage.config, modelled on PanoramicData.NugetManagement), uploads coverage.cobertura.xml to Codacy with codacy/codacy-coverage-reporter-action using the CODACY_PROJECT_TOKEN secret, and keeps the report as a 7-day artifact. The upload step is continue-on-error so a Codacy outage cannot turn a passing build red.

Which tests run

CI runs only tests that need no credentials; xunit.runner.json sets failSkips: true, so an unconfigured test would fail rather than skip. No test was deleted and no assertion changed.

Excluded: every test class deriving from TestBase (ApiVersionTests, DuplicateDeletionTests, GetJsonObjectTests, TaskTests, TicketTests), which calls the live AutoTask API with user-secret credentials; TestBase now carries [Trait("Category", "Integration")] and CI filters with Category!=Integration.

Measured locally in a clean mcr.microsoft.com/dotnet/sdk:10.0 Linux container with no user secrets, running exactly what CI runs: 11.6% line coverage.

Other changes

The test project now sets UseMicrosoftTestingPlatformRunner, without which the xunit v3 executable runs its native runner and rejects --coverage.

Tracked on https://jira.panoramicdata.com/browse/OPS-157454

🤖 Generated with Claude Code

Adds a coverage job to CI, on the pdl-public runner, that runs the offline
tests under Microsoft.Testing.Extensions.CodeCoverage and uploads the
Cobertura report to Codacy.

Excluded: every test class deriving from TestBase (ApiVersionTests, DuplicateDeletionTests, GetJsonObjectTests, TaskTests, TicketTests), which calls the live AutoTask API with user-secret credentials; TestBase now carries [Trait("Category", "Integration")] and CI filters with Category!=Integration.

Local line coverage (clean Linux container, no user secrets): 11.6%.

The test project now sets UseMicrosoftTestingPlatformRunner, without which the xunit v3 executable runs its native runner and rejects --coverage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage ∅ diff coverage

Metric Results
Coverage variation Report missing for 104925c1
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (104925c) Report Missing Report Missing Report Missing
Head commit (d757293) 1020 118 11.57%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#54) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit 89a51a0 into main Sep 27, 2026
7 checks passed
@davidnmbond
davidnmbond deleted the ci/codacy-coverage branch September 27, 2026 21:10
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.

1 participant