Union code coverage across all six pipelines#3716
Open
aaronburtle wants to merge 13 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a “Total Code Coverage” aggregation mechanism to provide a more accurate combined (union) coverage number across DAB’s six independent Azure DevOps pipelines by downloading each pipeline’s Cobertura output and merging them into a single report.
Changes:
- Introduces
scripts/merge-coverage.ps1, a dependency-free Cobertura union merger that can also emit a merged Cobertura XML for publishing. - Updates the unit-test pipeline to publish its coverage as a pipeline artifact and adds a new best-effort job that downloads latest DB-pipeline coverage and publishes a combined coverage report.
- Extends the shared build/unit-test template to stage and publish the unit coverage artifact used by the aggregation job.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/merge-coverage.ps1 | Adds a PowerShell Cobertura union-merger (line + branch) and optional merged XML emitter. |
| .pipelines/unittest-pipelines.yml | Converts the unit pipeline to multi-job and adds a best-effort “Total Code Coverage” aggregation job. |
| .pipelines/templates/build-pipelines.yml | Publishes unit Cobertura files as a pipeline artifact (coverage-unit) for later aggregation. |
…ad by name for aggregation
…or, warn on absent sources, map pipeline IDs
…r-edge branch union with floor fallback; guard 0/0 and de-dup inputs
…eport below either bound
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.
Why make this change?
Closes #3715
What is this change?
pipeline (
unittest-pipelines.yml) that surfaces the true combined coverageacross all six test pipelines, instead of the misleadingly low per-pipeline
numbers.
PostgreSql, MySql, DwSql, CosmosDb). Each publishes its own coverage tab and
nothing merges them, so every pipeline in isolation reads much lower than the union.
buildjob publishes this run's unit cobertura as acoverage-unitpipeline artifact.
total_code_coveragejob (dependsOn: build) downloads that plus thelatest available cobertura from the five DB pipelines
(
DownloadPipelineArtifact@2, definition IDs DwSql=1, MsSql=2, MySql=3,PgSql=4, Cosmos=6).
scripts/merge-coverage.ps1unions all reports and emits one combinedCobertura.xml, whichPublishCodeCoverageResults@2publishes.with
runVersion: latest, so it may reflect an older commit ADO offers noprimitive to block on all six sibling runs from inside one of them. A true
per-PR guarantee would require consolidating all suites into one pipeline with
a
dependsOn-all aggregation job. This is not necessary for tracking code coverage.continueOnErroron the job and every step, so it can neverfail or block unit CI. If aggregation fails, the build job's own unit-only
coverage remains as the tab fallback.
so points union correctly across Windows/Linux agents, and excludes
*.Testsassemblies.
How was this tested?
Validated
scripts/merge-coverage.ps1locally against real cobertura from all sixpipelines (combined = 76.77% branch / 83.33% line) and against synthetic reports
covering cross-agent path union, branch-condition max-merge, test-assembly
exclusion, and well-formed Cobertura output. Pipeline changes are CI-only.
Sample Request(s)