Skip to content

Commit 6d80aff

Browse files
committed
debug
Signed-off-by: zirain <[email protected]>
1 parent 7cc1b6e commit 6d80aff

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/conformance/conformance_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ func TestGatewayAPIConformance(t *testing.T) {
6060
if err != nil {
6161
t.Fatalf("Error creating conformance test suite: %v", err)
6262
}
63+
64+
defer func() {
65+
if t.Failed() {
66+
ege2etest.CollectResult(t, cSuite.RestConfig)
67+
}
68+
}()
69+
6370
cSuite.Setup(t, tests.ConformanceTests)
6471
if err := cSuite.Run(t, tests.ConformanceTests); err != nil {
6572
t.Fatalf("Error running conformance tests: %v", err)

test/e2e/tests/utils.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fortio.org/fortio/fhttp"
2424
"fortio.org/fortio/periodic"
2525
flog "fortio.org/log"
26+
tb "github.com/envoyproxy/gateway/internal/troubleshoot"
2627
"github.com/google/go-cmp/cmp"
2728
dto "github.com/prometheus/client_model/go"
2829
"github.com/prometheus/common/expfmt"
@@ -46,7 +47,6 @@ import (
4647

4748
egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1"
4849
"github.com/envoyproxy/gateway/internal/kubernetes"
49-
tb "github.com/envoyproxy/gateway/internal/troubleshoot"
5050
)
5151

5252
var (
@@ -626,13 +626,16 @@ func CollectAndDump(t *testing.T, rest *rest.Config) {
626626
tlog.Logf(t, "Skipping collecting and dumping cluster data, set ACTIONS_STEP_DEBUG=true to enable it")
627627
return
628628
}
629+
CollectResult(t, rest)
630+
}
629631

632+
func CollectResult(t *testing.T, rest *rest.Config) {
630633
dumpedNamespaces := []string{"envoy-gateway-system"}
631634
if IsGatewayNamespaceMode() {
632635
dumpedNamespaces = append(dumpedNamespaces, ConformanceInfraNamespace)
633636
}
634637

635-
result := tb.CollectResult(context.TODO(), rest, tb.CollectOptions{
638+
result := tb.CollectResult(t.Context(), rest, tb.CollectOptions{
636639
BundlePath: "",
637640
CollectedNamespaces: dumpedNamespaces,
638641
})

0 commit comments

Comments
 (0)