Skip to content

Commit 0f5ea39

Browse files
committed
add EnableCoverage variable
1 parent 2ffb5ea commit 0f5ea39

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

eng/azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ trigger:
66

77
variables:
88
system.debug: 'true'
9+
EnableCoverage: 'false'
910

1011
jobs:
1112
- job: Windows

eng/build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,22 @@ steps:
2424
command: test
2525
arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*"
2626
testRunTitle: $(Agent.JobName)
27+
condition: and(succeeded(), eq(variables['enableCoverage'], 'false'))
28+
29+
- task: DotNetCoreCLI@2
30+
displayName: Run tests
31+
inputs:
32+
command: test
33+
arguments: -c $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[coverlet.collector]*%2c[coverlet.core]*%2c[coverlet.msbuild.tasks]*" /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.xunit.extensions]*"
34+
testRunTitle: $(Agent.JobName)
35+
condition: and(succeeded(), eq(variables['enableCoverage'], 'true'))
2736

2837
- template: publish-coverlet-result-files.yml
2938

3039
- template: publish-coverage-results.yml
3140
parameters:
3241
reports: $(Build.SourcesDirectory)/**/coverage.opencover.xml
33-
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug'))
42+
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug'), eq(variables['enableCoverage'], 'true'))
3443
assemblyfilters: '-xunit'
3544

45+

0 commit comments

Comments
 (0)