-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for -cover
+ integration test code coverage
#7415
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #7415 +/- ##
==========================================
+ Coverage 19.57% 19.83% +0.25%
==========================================
Files 81 81
Lines 5461 7604 +2143
==========================================
+ Hits 1069 1508 +439
- Misses 4170 5870 +1700
- Partials 222 226 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -128,7 +132,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then | |||
fi | |||
|
|||
echo Building k3s | |||
CGO_ENABLED=1 "${GO}" build -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/k3s ./cmd/server/main.go | |||
CGO_ENABLED=1 "${GO}" build $BLDFLAGS -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/k3s ./cmd/server/main.go |
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.
Note that I am purposely not enclosing BLDFLAGS with quotes. This prevents empty "" from being added when BLDFLAG is not set, which breaks go build
-cover
+ integration test code coverage-cover
+ integration test code coverage
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
* Add support for -cover in k3s server * Update codecov reporting * Sigterm in StopK3sServer Signed-off-by: Derek Nola <[email protected]>
Proposed Changes
Adds the new cover flag in go 1.20. This enables us to get complete coverage reports from all our Integration tests.
Types of Changes
Build Feature
Verification
To use the new tool:
GOCOVER=1 make
GOCOVERDIR
env to an empty directory where the metadata + counters will be written togo tool covdata
to generate resultsgo tool covdata percent -i $GOCOVERDIR
produces a human readable percentage for all package filesgo tool covdata textfmt -i $GOCOVERDIR -o coverage.out
produces a report readable by tools like codecov and coverallsTesting
Linked Issues
User-Facing Change
Further Comments