Skip to content

Commit 2b2dd5a

Browse files
author
Tony Zhang
committed
excluding tests and sdk dirs from coverage analysis
1 parent 36fb815 commit 2b2dd5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/check_total_coverage.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ combined_coverage_file=$coverage_dir/combined.txt
55
COVERAGE_THRESHOLD=15.0 # percentage threshold of code coverage required
66

77
echo "Generating coverage report in text format..."
8-
go tool covdata merge -i=$coverage_dir/e2e,$coverage_dir/ut -o=$coverage_dir
8+
included_packages=$(go list ./... | grep -v /tests/ | grep -v '/sdk/') # not including 'tests' and 'sdk'
9+
go tool covdata merge -i=$coverage_dir/e2e,$coverage_dir/ut -o=$coverage_dir -pkg=${included_packages//$'\n'/,}
910
go tool covdata textfmt -i=./coverage -o $combined_coverage_file
1011
go tool cover -func $combined_coverage_file
1112

0 commit comments

Comments
 (0)