Skip to content
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

Merged
merged 7 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convention format
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed May 8, 2023

Verified

This commit was signed with the committer’s verified signature.
dereknola Derek Nola
commit d0648c5b6ccffd217b3268eb898580444210cae9
3 changes: 1 addition & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ func startOnAPIServerReady(ctx context.Context, config *Config) {
// writeCoverage checks if GOCOVERDIR is set on startup and writes coverage files to that directory
// every 20 seconds. This is done to ensure that the coverage files are written even if the process is killed.
func writeCoverage(ctx context.Context) {
dereknola marked this conversation as resolved.
Show resolved Hide resolved
k, s := os.LookupEnv("GOCOVERDIR")
if s {
if k, ok := os.LookupEnv("GOCOVERDIR"); ok {
for {
select {
case <-ctx.Done():
Expand Down
1 change: 0 additions & 1 deletion tests/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func K3sStartServer(inputArgs ...string) (*K3sServer, error) {
k3sBin := findK3sExecutable()
k3sCmd := append([]string{"server"}, inputArgs...)
cmd := exec.Command(k3sBin, k3sCmd...)
cmd.Env = os.Environ()
// Give the server a new group id so we can kill it and its children later
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
// Pipe output to a file for debugging later
Expand Down