Skip to content

Commit 07b9f4b

Browse files
committed
Publish raw cobertura as named artifact from each DB pipeline; download by name for aggregation
1 parent f1986f1 commit 07b9f4b

6 files changed

Lines changed: 84 additions & 9 deletions

File tree

.pipelines/cosmos-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,18 @@ steps:
142142
inputs:
143143
codeCoverageTool: Cobertura
144144
summaryFileLocation: '$(Agent.TempDirectory)/**/*cobertura.xml'
145+
146+
# Publish the RAW cobertura as a named pipeline artifact so the unit pipeline's
147+
# 'Total Code Coverage' job can download and union it. (PublishCodeCoverageResults@1
148+
# only exposes an HTML report artifact, not the raw XML, so aggregation needs this.)
149+
- task: CopyFiles@2
150+
displayName: 'Stage raw coverage for aggregation'
151+
inputs:
152+
sourceFolder: '$(Agent.TempDirectory)'
153+
contents: '**/*.cobertura.xml'
154+
targetFolder: '$(Build.ArtifactStagingDirectory)/coverage'
155+
- task: PublishPipelineArtifact@1
156+
displayName: 'Publish coverage artifact for aggregation'
157+
inputs:
158+
targetPath: '$(Build.ArtifactStagingDirectory)/coverage'
159+
artifact: 'coverage-cosmos'

.pipelines/dwsql-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,21 @@ jobs:
146146
codeCoverageTool: Cobertura
147147
summaryFileLocation: '$(Agent.TempDirectory)/**/*cobertura.xml'
148148

149+
# Publish the RAW cobertura as a named pipeline artifact so the unit pipeline's
150+
# 'Total Code Coverage' job can download and union it. (PublishCodeCoverageResults@1
151+
# only exposes an HTML report artifact, not the raw XML, so aggregation needs this.)
152+
- task: CopyFiles@2
153+
displayName: 'Stage raw coverage for aggregation'
154+
inputs:
155+
sourceFolder: '$(Agent.TempDirectory)'
156+
contents: '**/*.cobertura.xml'
157+
targetFolder: '$(Build.ArtifactStagingDirectory)/coverage'
158+
- task: PublishPipelineArtifact@1
159+
displayName: 'Publish coverage artifact for aggregation'
160+
inputs:
161+
targetPath: '$(Build.ArtifactStagingDirectory)/coverage'
162+
artifact: 'coverage-dwsql'
163+
149164

150165
- job: windows
151166
pool:

.pipelines/mssql-pipelines.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,20 @@ jobs:
151151
codeCoverageTool: Cobertura
152152
summaryFileLocation: '$(Agent.TempDirectory)/**/*cobertura.xml'
153153

154-
155-
# MsSql Integration Testing is split into two parallel jobs (~20 min each):
154+
# Publish the RAW cobertura as a named pipeline artifact so the unit pipeline's
155+
# 'Total Code Coverage' job can download and union it. (PublishCodeCoverageResults@1
156+
# only exposes an HTML report artifact, not the raw XML, so aggregation needs this.)
157+
- task: CopyFiles@2
158+
displayName: 'Stage raw coverage for aggregation'
159+
inputs:
160+
sourceFolder: '$(Agent.TempDirectory)'
161+
contents: '**/*.cobertura.xml'
162+
targetFolder: '$(Build.ArtifactStagingDirectory)/coverage'
163+
- task: PublishPipelineArtifact@1
164+
displayName: 'Publish coverage artifact for aggregation'
165+
inputs:
166+
targetPath: '$(Build.ArtifactStagingDirectory)/coverage'
167+
artifact: 'coverage-mssql'
156168
#
157169
# 1) windows_combined -> GraphQL, HotReload, REST, Unit, OpenApi, Auth,
158170
# Telemetry, and Caching tests.

.pipelines/mysql-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,18 @@ jobs:
145145
inputs:
146146
codeCoverageTool: Cobertura
147147
summaryFileLocation: '$(Agent.TempDirectory)/**/*cobertura.xml'
148+
149+
# Publish the RAW cobertura as a named pipeline artifact so the unit pipeline's
150+
# 'Total Code Coverage' job can download and union it. (PublishCodeCoverageResults@1
151+
# only exposes an HTML report artifact, not the raw XML, so aggregation needs this.)
152+
- task: CopyFiles@2
153+
displayName: 'Stage raw coverage for aggregation'
154+
inputs:
155+
sourceFolder: '$(Agent.TempDirectory)'
156+
contents: '**/*.cobertura.xml'
157+
targetFolder: '$(Build.ArtifactStagingDirectory)/coverage'
158+
- task: PublishPipelineArtifact@1
159+
displayName: 'Publish coverage artifact for aggregation'
160+
inputs:
161+
targetPath: '$(Build.ArtifactStagingDirectory)/coverage'
162+
artifact: 'coverage-mysql'

.pipelines/pg-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,18 @@ jobs:
140140
inputs:
141141
codeCoverageTool: Cobertura
142142
summaryFileLocation: '$(Agent.TempDirectory)/**/*cobertura.xml'
143+
144+
# Publish the RAW cobertura as a named pipeline artifact so the unit pipeline's
145+
# 'Total Code Coverage' job can download and union it. (PublishCodeCoverageResults@1
146+
# only exposes an HTML report artifact, not the raw XML, so aggregation needs this.)
147+
- task: CopyFiles@2
148+
displayName: 'Stage raw coverage for aggregation'
149+
inputs:
150+
sourceFolder: '$(Agent.TempDirectory)'
151+
contents: '**/*.cobertura.xml'
152+
targetFolder: '$(Build.ArtifactStagingDirectory)/coverage'
153+
- task: PublishPipelineArtifact@1
154+
displayName: 'Publish coverage artifact for aggregation'
155+
inputs:
156+
targetPath: '$(Build.ArtifactStagingDirectory)/coverage'
157+
artifact: 'coverage-pg'

.pipelines/unittest-pipelines.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ jobs:
5959
# ReportGenerator or other Marketplace extension is required.
6060
#
6161
# The DB 'pipeline' IDs below are the numeric definition IDs from Azure DevOps
62-
# (pipeline URL ...?definitionId=NN). The db-name labels are cosmetic; only the
63-
# numeric IDs matter for the download, and the merge is order-independent.
62+
# (pipeline URL ...?definitionId=NN). Each DB pipeline publishes its RAW cobertura
63+
# as a named 'coverage-<db>' pipeline artifact (added in its own YAML); this job
64+
# downloads those by name and unions them. NOTE: each DB pipeline must run once
65+
# after that change merges before its 'coverage-<db>' artifact exists - until then
66+
# its download soft-fails (continueOnError) and it's simply omitted from the union.
6467
- job: total_code_coverage
6568
displayName: 'Total Code Coverage (rolling dashboard)'
6669
dependsOn: build
@@ -89,7 +92,7 @@ jobs:
8992
project: '$(System.TeamProject)'
9093
pipeline: '2'
9194
runVersion: 'latest'
92-
patterns: '**/*.cobertura.xml'
95+
artifact: 'coverage-mssql'
9396
path: '$(Pipeline.Workspace)/db/mssql'
9497
- task: DownloadPipelineArtifact@2
9598
displayName: 'Download PostgreSql coverage (latest)'
@@ -99,7 +102,7 @@ jobs:
99102
project: '$(System.TeamProject)'
100103
pipeline: '4'
101104
runVersion: 'latest'
102-
patterns: '**/*.cobertura.xml'
105+
artifact: 'coverage-pg'
103106
path: '$(Pipeline.Workspace)/db/pg'
104107
- task: DownloadPipelineArtifact@2
105108
displayName: 'Download MySql coverage (latest)'
@@ -109,7 +112,7 @@ jobs:
109112
project: '$(System.TeamProject)'
110113
pipeline: '3'
111114
runVersion: 'latest'
112-
patterns: '**/*.cobertura.xml'
115+
artifact: 'coverage-mysql'
113116
path: '$(Pipeline.Workspace)/db/mysql'
114117
- task: DownloadPipelineArtifact@2
115118
displayName: 'Download DwSql coverage (latest)'
@@ -119,7 +122,7 @@ jobs:
119122
project: '$(System.TeamProject)'
120123
pipeline: '1'
121124
runVersion: 'latest'
122-
patterns: '**/*.cobertura.xml'
125+
artifact: 'coverage-dwsql'
123126
path: '$(Pipeline.Workspace)/db/dwsql'
124127
- task: DownloadPipelineArtifact@2
125128
displayName: 'Download CosmosDb coverage (latest)'
@@ -129,7 +132,7 @@ jobs:
129132
project: '$(System.TeamProject)'
130133
pipeline: '6'
131134
runVersion: 'latest'
132-
patterns: '**/*.cobertura.xml'
135+
artifact: 'coverage-cosmos'
133136
path: '$(Pipeline.Workspace)/db/cosmos'
134137

135138
# Union-merge every downloaded cobertura and emit ONE combined Cobertura.xml

0 commit comments

Comments
 (0)