Skip to content

Commit 353126a

Browse files
committed
publish multiple coverage reports since unable to merge diff oses
1 parent 8e342e3 commit 353126a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.pipelines/templates/run-unit-tests.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,24 @@ stages:
8484
sudo ln -s $(pwd)/build/tools/bin/gocov /usr/local/bin/gocov
8585
sudo ln -s $(pwd)/build/tools/bin/gocov-xml /usr/local/bin/gocov-xml
8686
87-
sed -i "1d" linux-coverage.out
88-
sed -i "1d" windows-coverage.out
87+
GOOS=linux gocov convert linux-coverage.out > linux-coverage.json
88+
GOOS=linux gocov-xml < linux-coverage.json > linux-coverage.xml
8989
90-
echo "mode: atomic" > total_ut_coverage.out
91-
cat linux-coverage.out >> total_ut_coverage.out
92-
cat windows-coverage.out >> total_ut_coverage.out
93-
94-
gocov convert total_ut_coverage.out > total_ut_coverage.json
95-
gocov-xml < total_ut_coverage.json > total_ut_coverage.xml
90+
GOOS=windows gocov convert windows-coverage.out > windows-coverage.json
91+
GOOS=windows gocov-xml < windows-coverage.json > windows-coverage.xml
92+
93+
mkdir coverage
94+
95+
mv linux-coverage.xml coverage/
96+
mv windows-coverage.xml coverage/
9697
name: "Coverage"
9798
displayName: "Generate Coverage Report"
9899
condition: always()
99100
- task: PublishCodeCoverageResults@2
100101
displayName: "Publish Code Coverage Report"
101102
condition: always()
102103
inputs:
103-
summaryFileLocation: total_ut_coverage.xml
104+
summaryFileLocation: coverage/*
104105
- task: BuildQualityChecks@8
105106
displayName: "Check Code Coverage Regression"
106107
condition: always()

0 commit comments

Comments
 (0)