Skip to content

Commit 0a9037b

Browse files
bpareessoltysh
authored andcommitted
Adapt to v2 by migrating use of config.GinkgoConfig to ginkgo.GinkgoConfiguration()
1 parent 67f6c37 commit 0a9037b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/extended/util/test.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"strings"
1212

1313
"github.com/onsi/ginkgo/v2"
14-
"github.com/onsi/ginkgo/v2/config"
1514
"github.com/onsi/ginkgo/v2/reporters"
1615
"github.com/onsi/gomega"
1716
"k8s.io/klog/v2"
@@ -112,14 +111,16 @@ func ExecuteTest(t ginkgo.GinkgoTestingT, suite string) {
112111
defer e2e.CoreDump(TestContext.ReportDir)
113112
}
114113

115-
if config.GinkgoConfig.FocusString == "" && config.GinkgoConfig.SkipString == "" {
116-
config.GinkgoConfig.SkipString = "Skipped"
114+
suiteConfig, _ := ginkgo.GinkgoConfiguration()
115+
116+
if len(suiteConfig.FocusStrings) == 0 && len(suiteConfig.SkipStrings) == 0 {
117+
suiteConfig.SkipStrings = []string{"Skipped"}
117118
}
118119

119120
gomega.RegisterFailHandler(ginkgo.Fail)
120121

121122
if TestContext.ReportDir != "" {
122-
r = append(r, reporters.NewJUnitReporter(path.Join(TestContext.ReportDir, fmt.Sprintf("%s_%02d.xml", reportFileName, config.GinkgoConfig.ParallelNode))))
123+
r = append(r, reporters.NewJUnitReporter(path.Join(TestContext.ReportDir, fmt.Sprintf("%s_%02d.xml", reportFileName, suiteConfig.ParallelProcess))))
123124
}
124125

125126
WithCleanup(func() {
@@ -268,13 +269,16 @@ func checkSyntheticInput() {
268269
// checkSuiteSkips ensures Origin/Kubernetes synthetic skip labels are applied
269270
// DEPRECATED: remove in a future release
270271
func checkSuiteSkips() {
272+
suiteConfig, _ := ginkgo.GinkgoConfiguration()
271273
switch {
272274
case isOriginTest():
273-
if strings.Contains(config.GinkgoConfig.SkipString, "Synthetic Origin") {
275+
skip := strings.Join(suiteConfig.SkipStrings, "|")
276+
if strings.Contains(skip, "Synthetic Origin") {
274277
ginkgo.Skip("skipping all openshift/origin tests")
275278
}
276279
case isKubernetesE2ETest():
277-
if strings.Contains(config.GinkgoConfig.SkipString, "Synthetic Kubernetes") {
280+
skip := strings.Join(suiteConfig.SkipStrings, "|")
281+
if strings.Contains(skip, "Synthetic Kubernetes") {
278282
ginkgo.Skip("skipping all k8s.io/kubernetes tests")
279283
}
280284
}

0 commit comments

Comments
 (0)