From 62891eefd60b9ac9d58a9fbbb58076bf9677400a Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Wed, 11 Sep 2024 13:43:50 -0700 Subject: [PATCH] Update PublishCodeCoverateResults task (#5972) --- eng/pipelines/templates/jobs/ci.tests.yml | 24 ++++++++++----------- eng/pipelines/templates/jobs/live.tests.yml | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 6c0c6646c7..5d0eef3749 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -270,14 +270,13 @@ jobs: displayName: Generate Code Coverage Data condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled')) - - task: PublishCodeCoverageResults@1 + - task: PublishCodeCoverageResults@2 inputs: - codeCoverageTool: Cobertura summaryFileLocation: '$(Build.SourcesDirectory)/**/Cobertura.xml' displayName: Publish Code Coverage to DevOps condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled')) - - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@8 + - task: BuildQualityChecks@9 displayName: Check line coverage inputs: checkCoverage: true @@ -287,15 +286,16 @@ jobs: coverageThreshold: ${{ parameters.LineCoverageTarget }} condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled'), eq(variables['Skip.LineCoverageEnforcement'], '')) - - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@8 - displayName: Check branch coverage - inputs: - checkCoverage: true - coverageFailOption: fixed - coverageType: branches - # Minimum baseline for branch coverage - coverageThreshold: ${{ parameters.BranchCoverageTarget }} - condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled'), eq(variables['Skip.BranchCoverageEnforcement'], '')) +# Disabling branch coverage check until newer tasks can support it see issue https://github.com/microsoft/azure-pipelines-tasks/issues/19669 tracking that request. +# - task: BuildQualityChecks@9 +# displayName: Check branch coverage +# inputs: +# checkCoverage: true +# coverageFailOption: fixed +# coverageType: branches +# # Minimum baseline for branch coverage +# coverageThreshold: ${{ parameters.BranchCoverageTarget }} +# condition: and(succeededOrFailed(), eq(variables['CODE_COVERAGE'], 'enabled'), eq(variables['Skip.BranchCoverageEnforcement'], '')) - task: Powershell@2 inputs: diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 4e6bca1851..2a2d739630 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -304,9 +304,8 @@ jobs: displayName: Generate Code Coverage Data condition: and(succeeded(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], '')) - - task: PublishCodeCoverageResults@1 + - task: PublishCodeCoverageResults@2 inputs: - codeCoverageTool: Cobertura summaryFileLocation: '$(Build.SourcesDirectory)/**/Cobertura.xml' displayName: Publish Code Coverage to DevOps condition: and(succeededOrFailed(), ne(variables['CODE_COVERAGE'], 'disabled'), ne(variables['CODE_COVERAGE'], ''))