Repository navigation
OPS-157454: Upload test coverage to Codacy from CI - #28
Conversation
Adds a coverage job on pdl-public that runs the test executable with
Microsoft.Testing.Extensions.CodeCoverage and uploads the Cobertura report
to Codacy.
The test project gains UseMicrosoftTestingPlatformRunner so the test
executable accepts --coverage; it already referenced
Microsoft.Testing.Extensions.CodeCoverage. The build job is unchanged and
still runs every test, including the live ones.
Excluded: The existing [Trait("Category", "Integration")] class
LegislationIntegrationTests (12 tests), which calls the live
www.legislation.gov.uk API. The coverage job filters it out with
Category!=Integration. The remaining 16 tests (LegislationApiUnitTests,
Category=Unit) were confirmed to pass in a container with no network at
all.
Local line coverage (clean Linux container): 52.4%.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | Report missing for b74e6471 |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (b74e647) Report Missing Report Missing Report Missing Head commit (d7b6d03) 309 162 52.43% 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 (#28) 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: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
What
Adds a
coveragejob toci.ymlthat runs the tests with code coverage and uploads the Cobertura report to Codacy. It runs onpdl-publicbecause the repository is public.--coverage(Microsoft.Testing.Extensions.CodeCoverage), using acoverage.configmodelled on PanoramicData.NugetManagement.codacy/codacy-coverage-reporter-action@v1using theCODACY_PROJECT_TOKENsecret. The upload hascontinue-on-error: true, and the report is also kept as a 7-day artifact.The test project gains UseMicrosoftTestingPlatformRunner so the test executable accepts --coverage; it already referenced Microsoft.Testing.Extensions.CodeCoverage. The build job is unchanged and still runs every test, including the live ones.
Excluded tests
The existing [Trait("Category", "Integration")] class LegislationIntegrationTests (12 tests), which calls the live www.legislation.gov.uk API. The coverage job filters it out with Category!=Integration. The remaining 16 tests (LegislationApiUnitTests, Category=Unit) were confirmed to pass in a container with no network at all.
Coverage
Local line coverage in a clean Linux container (
mcr.microsoft.com/dotnet/sdk:10.0.401, no user secrets) is 52.4%.Jira: https://jira.panoramicdata.com/browse/OPS-157454
🤖 Generated with Claude Code