OPS-157454: Upload test coverage to Codacy from CI - #51
Conversation
Adds a coverage job that runs the offline tests with
Microsoft.Testing.Extensions.CodeCoverage and uploads the Cobertura report
to Codacy.
Excluded: Every test class deriving from TestWithOutput drives a live LogicMonitor portal with credentials from user secrets; the base class is now tagged [Trait("Category", "Integration")] and the coverage job filters with --filter-not-trait "Category=Integration". 370 portal-free tests run, a superset of the 16 classes the build job lists.
Local line coverage (offline tests only, clean Linux container): 30.2%
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage ∅ diff coverage
Metric Results Coverage variation Report missing for 1500ad71 Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (1500ad7) Report Missing Report Missing Report Missing Head commit (c89a693) 6161 1861 30.21% 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 (#51) 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.
Summary
Adds a
coveragejob to CI that runs the test suite with Microsoft.Testing.Extensions.CodeCoverage and uploads the Cobertura report to Codacy withcodacy/codacy-coverage-reporter-action, modelled on PanoramicData.NugetManagement.pdl-publicself-hosted runner, never a GitHub-hosted one.continue-on-error: true, so a Codacy outage cannot turn a passing test run red. The report is also kept as a workflow artifact for 7 days.coverage.config(generated-code and test-assembly exclusions, matching the rest of the estate) where one was missing.Excluded tests
CI runs only tests that need no credentials. Every test class deriving from TestWithOutput drives a live LogicMonitor portal with credentials from user secrets; the base class is now tagged [Trait("Category", "Integration")] and the coverage job filters with --filter-not-trait "Category=Integration". 370 portal-free tests run, a superset of the 16 classes the build job lists.
The build job's existing "Portal-free unit tests" step passes xunit-native
-classarguments, so the project is not switched to the MTP runner; the coverage job usesdotnet test ... -- --coverageinstead. That step is unchanged.Coverage
Local line coverage from the offline tests, measured in a clean Linux container with no user secrets: 30.2%.
Tracked on OPS-157454.
🤖 Generated with Claude Code