-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoverage-report.sh
More file actions
29 lines (23 loc) · 881 Bytes
/
Copy pathcoverage-report.sh
File metadata and controls
29 lines (23 loc) · 881 Bytes
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
#!/bin/bash
echo "Install tools if not present"
dotnet tool install --global coverlet.console
dotnet tool install --global dotnet-reportgenerator-globaltool
echo "Clean and build solution"
dotnet restore
dotnet build Ambev.DeveloperEvaluation.sln --configuration Release --no-restore
echo "Run tests with coverage"
dotnet test Ambev.DeveloperEvaluation.sln --no-restore --verbosity normal \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=cobertura \
/p:CoverletOutput=./TestResults/coverage.cobertura.xml \
/p:Exclude="[*]*.Program,[*]*.Startup,[*]*.Migrations.*"
echo "Generate coverage report"
reportgenerator \
-reports:"./tests/**/TestResults/coverage.cobertura.xml" \
-targetdir:"./TestResults/CoverageReport" \
-reporttypes:Html
echo "Removing temporary files"
rm -rf bin obj
echo ""
echo "Coverage report generated at TestResults/CoverageReport/index.html"
pause