Skip to content

Commit

Permalink
add logs to debug gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Apr 11, 2024
1 parent 7c5ffeb commit e930343
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions e2e/capture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ func TestFlowCapture(t *testing.T) {
// TODO: find a way to avoid error here; this is probably related to SIGTERM instead of CTRL + C call
//assert.Nil(t, err)

// print output to cmd
str := string(output)
fmt.Println(str)

err = os.WriteFile(path.Join("output", startupDate+"-flowOutput"), output, 0666)
assert.Nil(t, err)

str := string(output)
assert.NotEmpty(t, str)
// ensure script setup is fine
assert.Contains(t, str, "namespace/netobserv-cli created")
Expand Down Expand Up @@ -127,10 +130,13 @@ func TestPacketCapture(t *testing.T) {
// TODO: find a way to avoid error here; this is probably related to SIGTERM instead of CTRL + C call
//assert.Nil(t, err)

// print output to cmd
str := string(output)
fmt.Println(str)

err = os.WriteFile(path.Join("output", startupDate+"-packetOutput"), output, 0666)
assert.Nil(t, err)

str := string(output)
assert.NotEmpty(t, str)
// ensure script setup is fine
assert.Contains(t, str, "namespace/netobserv-cli created")
Expand Down Expand Up @@ -191,6 +197,7 @@ func runCommand(commandName string, arg ...string) ([]byte, error) {
log.Print("Opening tty...")
t, err := tty.Open()
if err != nil {
klog.WithField("err", err).Info("can't open tty")

Check failure on line 200 in e2e/capture_test.go

View workflow job for this annotation

GitHub Actions / e2e-tests

undefined: klog
return nil, err
}
defer t.Close()
Expand Down
2 changes: 1 addition & 1 deletion e2e/cluster/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (k *Kind) deleteNamespace() env.Func {
return func(ctx context.Context, config *envconf.Config) (context.Context, error) {
exe := gexe.New()
out := exe.Run("kubectl delete namespace netobserv-cli")
klog.WithField("out", out).Debug("deleted namespace")
klog.WithField("out", out).Info("deleted namespace")
return ctx, nil
}
}
Expand Down

0 comments on commit e930343

Please sign in to comment.