From a5e53bc5db971bd7563991d6acdc70f4633635c1 Mon Sep 17 00:00:00 2001 From: justinsb Date: Tue, 22 Oct 2024 14:36:42 -0400 Subject: [PATCH] tests: warn, don't panic, if we can't read spec.resourceID This shouldn't happen, but we need to know why it happens if it does. --- tests/e2e/unified_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/unified_test.go b/tests/e2e/unified_test.go index b7d71d2df7..9ee47b7ce7 100644 --- a/tests/e2e/unified_test.go +++ b/tests/e2e/unified_test.go @@ -221,9 +221,9 @@ func runScenario(ctx context.Context, t *testing.T, testPause bool, fixture reso for _, create := range opt.Create { resourceID, _, err := unstructured.NestedString(create.Object, "spec", "resourceID") if err != nil { - t.Fatalf("error reading spec.resourceID: %v", err) - } - if strings.Contains(resourceID, "${resourceId}") { + j, _ := json.Marshal(create.Object) + t.Logf("error reading spec.resourceID, can't check for acquisition test: %v. object is %v", err, string(j)) + } else if strings.Contains(resourceID, "${resourceId}") { t.Skipf("test has ${resourceId} placeholder in spec.resource, indicating an acquisition test. Not currently supported here; skipping") } }