Fix coverage report for template and core pipelines (#1002)

Root Cause:
Storage project generates coverage files in a different location (sdk/*/*cov_xml.xml) from where Core and Template (sdk/*/*/*cov_xml.xml). Basically one level up.

When I added the coverage for Storage, I didn’t know we were also running live tests for Core and Template pipelines. It failed on them because the xml files were not found.

In the PR, I add a new parameter to pipelines to change the default path, and also I am disabling LiveTests from Core and Template, since it only runs the same thing that we run on CI pipelines (We can enable it if we ever have some live tests)


fix: #1001
This commit is contained in:
Victor Vazquez 2020-11-19 12:19:57 -08:00 committed by GitHub
parent e2bfa85d8b
commit ac09ee6f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 4 deletions

View File

@ -4,6 +4,7 @@ parameters:
Coverage: ''
CtestRegex: .*
BuildReleaseArtifacts: true
CoverageReportPath: 'sdk/*/*/*cov_xml.xml'
jobs:
- job: Validate
@ -119,7 +120,7 @@ jobs:
# coverage report
- bash: |
make `cat ${{ parameters.ServiceDirectory }}-targets-coverage.txt`
../tools/reportgenerator "-reports:sdk/*/*/*cov_xml.xml" "-targetdir:." "-reporttypes:Cobertura"
../tools/reportgenerator "-reports:${{ parameters.CoverageReportPath }}" "-targetdir:." "-reporttypes:Cobertura"
workingDirectory: build
displayName: Generate Code Coverage Data
condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], ''))

View File

@ -14,6 +14,9 @@ parameters:
- name: Coverage
type: string
default: 'enabled'
- name: CoverageReportPath
type: string
default: sdk/*/*/*cov_xml.xml
jobs:
- job: Validate
@ -93,7 +96,7 @@ jobs:
# coverage report
- bash: |
make `cat ${{ parameters.ServiceDirectory }}-targets-coverage.txt`
../tools/reportgenerator "-reports:sdk/*/*cov_xml.xml" "-targetdir:." "-reporttypes:Cobertura"
../tools/reportgenerator "-reports:${{ parameters.CoverageReportPath }}" "-targetdir:." "-reporttypes:Cobertura"
workingDirectory: build
displayName: Generate Code Coverage Data
condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], ''))

View File

@ -20,6 +20,9 @@ parameters:
- name: SubscriptionConfiguration
type: string
default: $(sub-config-azure-cloud-test-resources)
- name: CoverageReportPath
type: string
default: 'sdk/*/*/*cov_xml.xml'
stages:
- stage: Build
@ -30,6 +33,7 @@ stages:
Artifacts: ${{ parameters.Artifacts }}
CtestRegex: ${{ parameters.CtestRegex }}
Coverage: ${{ parameters.Coverage }}
CoverageReportPath: ${{ parameters.CoverageReportPath }}
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}:
- stage: LiveTest
@ -42,6 +46,7 @@ stages:
CtestRegex: ${{ parameters.LiveTestCtestRegex }}
Location: ${{ parameters.Location }}
SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }}
CoverageReportPath: ${{ parameters.CoverageReportPath }}
- ${{ if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'), not(endsWith(variables['Build.DefinitionName'], ' - tests'))) }}:
- template: archetype-cpp-release.yml

View File

@ -32,7 +32,6 @@ stages:
parameters:
ServiceDirectory: core
CtestRegex: azure-core.
LiveTestCtestRegex: azure-core.
Artifacts:
- Name: azure-core
Path: azure-core

View File

@ -39,6 +39,7 @@ stages:
CtestRegex: no-run
Coverage: disabled
LiveTestCtestRegex: azure-storage
CoverageReportPath: sdk/*/*cov_xml.xml
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview)
Artifacts:
- Name: azure-storage-common

View File

@ -34,7 +34,6 @@ stages:
parameters:
ServiceDirectory: template
CtestRegex: azure-template
LiveTestCtestRegex: azure-template
Artifacts:
- Name: azure-template
Path: azure-template