Repository navigation
OPS-157454: Upload test coverage to Codacy from CI - #54
Conversation
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>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage ∅ diff coverage
Metric Results Coverage variation Report missing for 104925c1 Diff coverage ✅ ∅ diff coverage 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.
TIP This summary will be updated as you push new changes.
What
Adds a
coveragejob to CI, on the same push and pull_request triggers as the build and on thepdl-publicrunner (never a GitHub-hosted one). It builds the test project, runs the Microsoft.Testing.Platform test executable with--coverage(Microsoft.Testing.Extensions.CodeCoverage, settings incoverage.config, modelled on PanoramicData.NugetManagement), uploadscoverage.cobertura.xmlto Codacy withcodacy/codacy-coverage-reporter-actionusing theCODACY_PROJECT_TOKENsecret, and keeps the report as a 7-day artifact. The upload step iscontinue-on-errorso a Codacy outage cannot turn a passing build red.Which tests run
CI runs only tests that need no credentials;
xunit.runner.jsonsetsfailSkips: 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.0Linux 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