OPS-157454: Upload test coverage to Codacy from CI - #38
Open
davidnmbond wants to merge 1 commit into
Open
davidnmbond wants to merge 1 commit into
davidnmbond wants to merge 1 commit into
Conversation
Adds a coverage job on pdl-public that runs the unit test executable with
Microsoft.Testing.Extensions.CodeCoverage and uploads the Cobertura report
to Codacy.
Serilog.Sinks.LogicMonitor.Tests moves from xunit v2 on VSTest to xunit.v3 on
Microsoft.Testing.Platform, which coverage collection needs. This also fixes
the build job's dotnet test step, which has failed on main since global.json
opted into MTP ("The following test projects are using VSTest test runner").
No test source changes were needed.
Excluded: the Serilog.Sinks.LogicMonitor.IntegrationTests project, which
writes to a live LogicMonitor portal using credentials CI does not have.
Local line coverage of the 10 unit tests (clean Linux container): 15.8%.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
coveragejob toci.ymlthat runs the unit tests with code coverage and uploads the Cobertura report to Codacy. It runs onpdl-publicbecause the repository is public.Serilog.Sinks.LogicMonitor.Testsmoves from xunit v2 on VSTest toxunit.v3on Microsoft.Testing.Platform, plusMicrosoft.Testing.Extensions.CodeCoverage. Coverage collection needs this. No test source changes were needed.dotnet teststep has failed onmainsinceglobal.jsonopted into MTP. The error was "The following test projects are using VSTest test runner: Serilog.Sinks.LogicMonitor.Tests.csproj".coverage.configtaken from 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.Excluded tests
The
Serilog.Sinks.LogicMonitor.IntegrationTestsproject is not run by the coverage job. It writes to a live LogicMonitor portal using credentials fromappsettings.json, which CI does not have.Coverage
Local line coverage of the 10 unit tests, in a clean Linux container (
mcr.microsoft.com/dotnet/sdk:10.0.401), is 15.8%.Jira: https://jira.panoramicdata.com/browse/OPS-157454
🤖 Generated with Claude Code