diff --git a/test/e2e/common.go b/test/e2e/common.go index fe9fb874fbc..d6376958cc9 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -32,6 +32,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/blang/semver" . "github.com/onsi/ginkgo/v2" + "github.com/onsi/ginkgo/v2/types" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -294,10 +295,10 @@ func EnsureControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyCl // CheckTestBeforeCleanup checks to see if the current running Ginkgo test failed, and prints // a status message regarding cleanup. func CheckTestBeforeCleanup() { - if CurrentGinkgoTestDescription().Failed { + if CurrentSpecReport().State.Is(types.SpecStateFailureStates) { Logf("FAILED!") } - Logf("Cleaning up after \"%s\" spec", CurrentGinkgoTestDescription().FullTestText) + Logf("Cleaning up after \"%s\" spec", CurrentSpecReport().FullText()) } func discoveryAndWaitForControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyClusterTemplateAndWaitInput, result *clusterctl.ApplyClusterTemplateAndWaitResult) *kubeadmv1.KubeadmControlPlane { diff --git a/test/e2e/helpers.go b/test/e2e/helpers.go index c140de63a8c..55ad77c1247 100644 --- a/test/e2e/helpers.go +++ b/test/e2e/helpers.go @@ -425,7 +425,7 @@ func getAvailabilityZonesForRegion(location string, size string) ([]string, erro // INFO: "With 1 worker node" started at Tue, 22 Sep 2020 13:19:08 PDT on Ginkgo node 2 of 3 // INFO: "With 1 worker node" ran for 18m34s on Ginkgo node 2 of 3 func logCheckpoint(specTimes map[string]time.Time) { - text := CurrentGinkgoTestDescription().TestText + text := CurrentSpecReport().LeafNodeText start, started := specTimes[text] suiteConfig, reporterConfig := GinkgoConfiguration() if !started {