-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve test coverage #1840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve test coverage #1840
Conversation
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
Signed-off-by: David Gageot <[email protected]>
It’s currently waiting for all the tests to end to print the output Signed-off-by: David Gageot <[email protected]>
d0255a7
to
ec9239c
Compare
Signed-off-by: David Gageot <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1840 +/- ##
==========================================
+ Coverage 47.91% 49.64% +1.72%
==========================================
Files 144 165 +21
Lines 6499 7145 +646
==========================================
+ Hits 3114 3547 +433
- Misses 3101 3270 +169
- Partials 284 328 +44
Continue to review full report at Codecov.
|
I still don't understand how Codecov is computing coverage... |
ec9239c
to
beed7c2
Compare
test.sh
Outdated
@@ -21,7 +21,8 @@ GREEN='\033[0;32m' | |||
RESET='\033[0m' | |||
|
|||
echo "Running go tests..." | |||
go test -count=1 -race -cover -short -timeout 60s -coverprofile=out/coverage.txt -covermode=atomic ./... | grep -v 'no test files' | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/'' | |||
go test -cover -short -timeout=60s -coverprofile=out/coverage.txt -coverpkg="./pkg/...,./cmd/..." ./... | awk -v FAIL="${RED}FAIL${RESET}" '! /no test files/ { gsub("FAIL", FAIL, $0); print $0 }' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this removes the race detector - is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
beed7c2
to
d2abf81
Compare
Not just on the package the test belongs to Signed-off-by: David Gageot <[email protected]>
d2abf81
to
ca96952
Compare
@balopat should be all good now |
This improves the coverage of a few pieces of code.
It also configures
go test
so that test coverage is counted on every package, not the package that the test belongs to. This should show our real test coverage.