Skip to content

Commit

Permalink
Add detailed output for traceflow tests (#5779)
Browse files Browse the repository at this point in the history
Signed-off-by: Hang Yan <[email protected]>
  • Loading branch information
hangyan authored Jan 5, 2024
1 parent 43427a1 commit fed260a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
github.com/containernetworking/cni v1.1.1
github.com/containernetworking/plugins v1.1.1
github.com/coreos/go-iptables v0.7.0
github.com/davecgh/go-spew v1.1.1
github.com/fsnotify/fsnotify v1.7.0
github.com/gammazero/deque v0.1.2
github.com/go-logr/logr v1.4.1
Expand Down Expand Up @@ -121,7 +122,6 @@ require (
github.com/contiv/libovsdb v0.0.0-20170227191248-d0061a53e358 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/traceflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"testing"
"time"

"github.com/davecgh/go-spew/spew"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -2557,7 +2558,7 @@ func runTestTraceflow(t *testing.T, data *TestData, tc testcase) {
pktCap.TransportHeader.ICMP = &v1beta1.ICMPEchoRequestHeader{}
}
if !reflect.DeepEqual(tc.expectedPktCap, pktCap) {
t.Fatalf("Captured packet should be: %+v, but got: %+v", tc.expectedPktCap, tf.Status.CapturedPacket)
t.Fatalf("Captured packet should be: %s, but got: %s", spew.Sdump(tc.expectedPktCap), spew.Sdump(tf.Status.CapturedPacket))
}
}
}

0 comments on commit fed260a

Please sign in to comment.