forked from googleapis/google-cloud-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatecoveragereport.sh
40 lines (29 loc) · 1.02 KB
/
createcoveragereport.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
source toolversions.sh
install_dotcover
install_reportgenerator
if [ ! -d coverage ]
then
mkdir coverage
fi
if ! compgen -G "coverage/*.dvcr"
then
echo "No coverage reports found to merge."
# This isn't an error
exit 0
fi
rm -f coverage/all.dvcr
echo "Merging reports..."
$DOTCOVER merge -Source=$(echo coverage/*.dvcr | sed 's/ /;/g') -Output=coverage/all.dvcr ""
echo "Generating detailed xml report..."
$DOTCOVER report -Source=coverage/all.dvcr -Output=coverage/coverage.xml -ReportType=DetailedXML ""
# We assume the tools solution has already been restored as part of the build
echo "Filtering xml report..."
dotnet run -p tools/Google.Cloud.Tools.TrimCoverageReport/Google.Cloud.Tools.TrimCoverageReport.csproj -- coverage/coverage.xml coverage/coverage-filtered.xml
echo "Running ReportGenerator to create an html report..."
$REPORTGENERATOR \
-reports:coverage/coverage-filtered.xml \
-targetdir:coverage/report \
-verbosity:Error
# TODO(benwu): upload coverage/report to public blob storage