Skip to content

Commit 8a7e6fc

Browse files
committed
add EnableCoverage variable
1 parent 2ffb5ea commit 8a7e6fc

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
@@ -20,16 +20,26 @@ steps:
2020

2121
- task: DotNetCoreCLI@2
2222
displayName: Run tests
23+
inputs:
24+
command: test
25+
arguments: -c $(BuildConfiguration) --no-build
26+
testRunTitle: $(Agent.JobName)
27+
condition: and(succeeded(), eq(variables['enableCoverage'], 'false'))
28+
29+
- task: DotNetCoreCLI@2
30+
displayName: Run tests with coverage
2331
inputs:
2432
command: test
2533
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]*"
2634
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)