diff --git a/build/CodeCoverage.runsettings b/build/CodeCoverage.runsettings index 57be05f429..3f5d0445e7 100644 --- a/build/CodeCoverage.runsettings +++ b/build/CodeCoverage.runsettings @@ -1,40 +1,46 @@ - + - - - - - - - - - + + + + + + + + - - - - - .*\microsoft.identitymodel.clients.activedirectory.dll$ - .*\microsoft.identity.core.dll$ - .*\microsoft.identity.client.dll$ - - - - - - - - - - - - - \ No newline at end of file +--> + + + .*\microsoft.identity.client.dll$ + + + .*\\test\\.* + .*Test\.dll + .*Test\.exe + + + + + .*\\devapps\\.* + .*\\CacheCompat\\.* + .*\\obj\\.* + .*\\json\\.* + .*\\android\\.* + .*\\ios\\.* + + + + + + + + diff --git a/build/template-build-and-run-all-tests.yaml b/build/template-build-and-run-all-tests.yaml index 3ae0aeacbd..80ec5d5ffb 100644 --- a/build/template-build-and-run-all-tests.yaml +++ b/build/template-build-and-run-all-tests.yaml @@ -67,3 +67,16 @@ jobs: #Build and stage projects steps: - template: template-desktop-unit-and-automation.yaml + + - task: BuildQualityChecks@9 + inputs: + checkCoverage: true + coverageFailOption: 'build' + coverageType: 'lines' + treat0of0as100: true + forceCoverageImprovement: true + coverageUpperThreshold: '90' + includePartiallySucceeded: false + fallbackOnPRTargetBranch: false + baseDefinitionId: '905' #this is the PR build and it is used as a baseline + baseBranchRef: 'main' diff --git a/build/template-run-cachecompat-tests.yaml b/build/template-run-cachecompat-tests.yaml index 6d5f973db6..a2930256fe 100644 --- a/build/template-run-cachecompat-tests.yaml +++ b/build/template-run-cachecompat-tests.yaml @@ -9,7 +9,7 @@ steps: testSelector: 'testAssemblies' testAssemblyVer2: '**\CacheCompat\CommonCache.Test.Unit\bin\**\CommonCache.Test.Unit.dll' searchFolder: '$(System.DefaultWorkingDirectory)' - codeCoverageEnabled: true + codeCoverageEnabled: false failOnMinTestsNotRun: true minimumExpectedTests: '1' runInParallel: true diff --git a/build/template-run-integration-tests.yaml b/build/template-run-integration-tests.yaml index 52d58b860a..3804db4317 100644 --- a/build/template-run-integration-tests.yaml +++ b/build/template-run-integration-tests.yaml @@ -13,7 +13,7 @@ steps: rerunFailedTests: true rerunMaxAttempts: '3' runInParallel: false - codeCoverageEnabled: true + codeCoverageEnabled: false failOnMinTestsNotRun: true minimumExpectedTests: '1' pathtoCustomTestAdapters: 'C:\temp' # Workaround for test failure, as NUnit Test Adapter that gets detected seems to mess something up @@ -28,7 +28,7 @@ steps: rerunFailedTests: true rerunMaxAttempts: '3' runInParallel: false - codeCoverageEnabled: true + codeCoverageEnabled: false failOnMinTestsNotRun: true minimumExpectedTests: '1' @@ -44,3 +44,4 @@ steps: codeCoverageEnabled: true failOnMinTestsNotRun: true minimumExpectedTests: '1' + runSettingsFile: 'build\CodeCoverage.runsettings' diff --git a/build/template-run-unit-tests.yaml b/build/template-run-unit-tests.yaml index 0784e26be4..1c2f453fb6 100644 --- a/build/template-run-unit-tests.yaml +++ b/build/template-run-unit-tests.yaml @@ -14,7 +14,7 @@ steps: testAssemblyVer2: '**\Microsoft.Identity.Test.Unit\bin\**\net4*\Microsoft.Identity.Test.Unit.dll' searchFolder: '$(System.DefaultWorkingDirectory)' runInParallel: true - codeCoverageEnabled: true + codeCoverageEnabled: false failOnMinTestsNotRun: true minimumExpectedTests: '1' pathtoCustomTestAdapters: 'C:\temp' # Workaround for test failure, as NUnit Test Adapter that gets detected seems to mess something up @@ -27,7 +27,7 @@ steps: testAssemblyVer2: '**\Microsoft.Identity.Test.Unit\bin\**\net4*\Microsoft.Identity.Test.Unit.dll' searchFolder: '$(System.DefaultWorkingDirectory)' runInParallel: true - codeCoverageEnabled: true + codeCoverageEnabled: false failOnMinTestsNotRun: true minimumExpectedTests: '1' @@ -41,3 +41,4 @@ steps: codeCoverageEnabled: true failOnMinTestsNotRun: true minimumExpectedTests: '1' + runSettingsFile: 'build\CodeCoverage.runsettings'