Skip to content

Commit 472d767

Browse files
authored
Merge pull request #3502 from mboersma/fix-ginkgo-v2-deprecation-warnings
Fix Ginkgov2 deprecation warnings
2 parents 4c97dde + 631edec commit 472d767

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/e2e/common.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/Azure/go-autorest/autorest/azure/auth"
3333
"github.com/blang/semver"
3434
. "github.com/onsi/ginkgo/v2"
35+
"github.com/onsi/ginkgo/v2/types"
3536
. "github.com/onsi/gomega"
3637
corev1 "k8s.io/api/core/v1"
3738
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -294,10 +295,10 @@ func EnsureControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyCl
294295
// CheckTestBeforeCleanup checks to see if the current running Ginkgo test failed, and prints
295296
// a status message regarding cleanup.
296297
func CheckTestBeforeCleanup() {
297-
if CurrentGinkgoTestDescription().Failed {
298+
if CurrentSpecReport().State.Is(types.SpecStateFailureStates) {
298299
Logf("FAILED!")
299300
}
300-
Logf("Cleaning up after \"%s\" spec", CurrentGinkgoTestDescription().FullTestText)
301+
Logf("Cleaning up after \"%s\" spec", CurrentSpecReport().FullText())
301302
}
302303

303304
func discoveryAndWaitForControlPlaneInitialized(ctx context.Context, input clusterctl.ApplyClusterTemplateAndWaitInput, result *clusterctl.ApplyClusterTemplateAndWaitResult) *kubeadmv1.KubeadmControlPlane {

test/e2e/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func getAvailabilityZonesForRegion(location string, size string) ([]string, erro
425425
// INFO: "With 1 worker node" started at Tue, 22 Sep 2020 13:19:08 PDT on Ginkgo node 2 of 3
426426
// INFO: "With 1 worker node" ran for 18m34s on Ginkgo node 2 of 3
427427
func logCheckpoint(specTimes map[string]time.Time) {
428-
text := CurrentGinkgoTestDescription().TestText
428+
text := CurrentSpecReport().LeafNodeText
429429
start, started := specTimes[text]
430430
suiteConfig, reporterConfig := GinkgoConfiguration()
431431
if !started {

0 commit comments

Comments
 (0)