Skip to content

Commit

Permalink
go: exclude examples from test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
atonks2 committed Feb 9, 2024
1 parent 1581c52 commit c3e1e84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/lint-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ if [[ "$COVER_THRESHOLD" != "" ]]; then
if [[ -f "$coveragePath" && "$PROFILE_GOTEST" != "yes" ]];
then
# Ignore test directories in coverage analysis
cat "$coveragePath" | grep -v -E "/pkg*/*test" | grep -v -E "/internal*/*test" > coverage.txt
cat "$coveragePath" | grep -v -E "/pkg*/*test" | grep -v -E "/internal*/*test" | grep -v -E "/examples*/*" > coverage.txt
coveredStatements=$(go tool cover -func=coverage.txt | grep -E '^total:' | grep -Eo '[0-9]+\.[0-9]+')
maximumCoverage=100
fi
Expand Down

0 comments on commit c3e1e84

Please sign in to comment.