From b0db52ef497f7c7880818579aa80c269f516c422 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 9 Nov 2023 12:04:57 -0500 Subject: [PATCH] e2e: Spew ODataError details before panicing (#3265) Co-authored-by: Matthew Barnes --- test/e2e/setup.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/e2e/setup.go b/test/e2e/setup.go index 32f3a74746a..ded80fd8326 100644 --- a/test/e2e/setup.go +++ b/test/e2e/setup.go @@ -18,6 +18,7 @@ import ( . "github.com/onsi/gomega" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/davecgh/go-spew/spew" "github.com/jongio/azidext/go/azidext" configclient "github.com/openshift/client-go/config/clientset/versioned" machineclient "github.com/openshift/client-go/machine/clientset/versioned" @@ -44,6 +45,7 @@ import ( redhatopenshift20230701preview "github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/redhatopenshift/2023-07-01-preview/redhatopenshift" "github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/storage" "github.com/Azure/ARO-RP/pkg/util/cluster" + msgraph_errors "github.com/Azure/ARO-RP/pkg/util/graph/graphsdk/models/odataerrors" utillog "github.com/Azure/ARO-RP/pkg/util/log" "github.com/Azure/ARO-RP/pkg/util/uuid" "github.com/Azure/ARO-RP/test/util/kubeadminkubeconfig" @@ -440,6 +442,9 @@ var _ = BeforeSuite(func() { SetDefaultEventuallyPollingInterval(10 * time.Second) if err := setup(context.Background()); err != nil { + if oDataError, ok := err.(msgraph_errors.ODataErrorable); ok { + spew.Dump(oDataError.GetErrorEscaped()) + } panic(err) } }) @@ -448,6 +453,9 @@ var _ = AfterSuite(func() { log.Info("AfterSuite") if err := done(context.Background()); err != nil { + if oDataError, ok := err.(msgraph_errors.ODataErrorable); ok { + spew.Dump(oDataError.GetErrorEscaped()) + } panic(err) } })