Skip to content
Snippets Groups Projects
Commit aace2ba2 authored by Jonah Husson's avatar Jonah Husson
Browse files

Exclude from coverage

parent 7fadd15d
Branches
No related tags found
2 merge requests!38Project/haven beta,!36Update notifications bot to allow multiple identities & devices
......@@ -33,12 +33,12 @@ build:
# Test coverage
- go-acc --covermode atomic --output testdata/coverage.out ./... -- -v
# Exclude cmd from test coverage as it is command line related tooling
# - grep -v -e cmd testdata/coverage.out > testdata/coverage-real.out
- go tool cover -func=testdata/coverage.out
- go tool cover -html=testdata/coverage.out -o testdata/coverage.html
- grep -v -e cmd -e storage -e testutil testdata/coverage.out > testdata/coverage-real.out
- go tool cover -func=testdata/coverage-real.out
- go tool cover -html=testdata/coverage-real.out -o testdata/coverage.html
# Test Coverage Check
- go tool cover -func=testdata/coverage.out | grep "total:" | awk '{print $3}' | sed 's/\%//g' > testdata/coverage-percentage.txt
- go tool cover -func=testdata/coverage-real.out | grep "total:" | awk '{print $3}' | sed 's/\%//g' > testdata/coverage-percentage.txt
- export CODE_CHECK=$(echo "$(cat testdata/coverage-percentage.txt) >= $MIN_CODE_COVERAGE" | bc -l)
- (if [ "$CODE_CHECK" == "1" ]; then echo "Minimum coverage of $MIN_CODE_COVERAGE succeeded"; else echo "Minimum coverage of $MIN_CODE_COVERAGE failed"; exit 1; fi);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment