Skip to content

Commit 533171a

Browse files
authored
Upload coverage files only when all tests pass. (#2308)
* Upload coverage files only when all tests pass. * fix branch name parameter in codecov command.
1 parent 591ad35 commit 533171a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build/Codecoverage.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PropertyGroup>
1414
<_CodecovPath>$(RestorePackagesPath)codecov\$(CodecovVersion)\tools\Codecov.exe</_CodecovPath>
1515
<_ReportGeneratorPath>$(RestorePackagesPath)reportgenerator\$(ReportGeneratorVersion)\tools\net47\ReportGenerator.exe</_ReportGeneratorPath>
16-
<_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH)</_BranchName>
16+
<_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_SOURCEBRANCH)</_BranchName>
1717
<_BranchName Condition="'$(_BranchName)' == ''">$(BUILD_SOURCEBRANCHNAME)</_BranchName>
1818
</PropertyGroup>
1919

build/ci/phase-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ phases:
4141
displayName: Run Tests.
4242
- script: $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet msbuild build/Codecoverage.proj /p:CodeCovToken=$(CODECOV_TOKEN)
4343
displayName: Upload coverage to codecov.io
44-
condition: eq(variables._codeCoverage, 'true')
44+
condition: and(succeeded(), eq(variables._codeCoverage, 'true'))
4545
- task: PublishTestResults@2
4646
displayName: Publish Test Results
4747
condition: succeededOrFailed()

0 commit comments

Comments
 (0)