From ed955905fedb8c2b676213919778f04ca3077f95 Mon Sep 17 00:00:00 2001 From: Bartosz Chwila <103247439+barchw@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:39:48 +0100 Subject: [PATCH] Only use scenario initializer for v2alpha1 tests (#1521) --- tests/integration/main_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/integration/main_test.go b/tests/integration/main_test.go index 84643fff4..e5755b534 100644 --- a/tests/integration/main_test.go +++ b/tests/integration/main_test.go @@ -99,9 +99,18 @@ func TestV2alpha1(t *testing.T) { func runTestsuite(t *testing.T, testsuite testcontext.Testsuite) { opts := createGoDogOpts(t, testsuite.FeaturePath(), testsuite.TestConcurrency()) suite := godog.TestSuite{ - Name: testsuite.Name(), - ScenarioInitializer: testsuite.InitScenarios, + Name: testsuite.Name(), + ScenarioInitializer: func() func(*godog.ScenarioContext) { + if testsuite.Name() == "v2alpha1" { + return testsuite.InitScenarios + } + return nil + }(), TestSuiteInitializer: func(ctx *godog.TestSuiteContext) { + if testsuite.Name() != "v2alpha1" { + testsuite.InitScenarios(ctx.ScenarioContext()) + } + ctx.BeforeSuite(func() { log.Printf("Executing before suite hooks") for _, hook := range testsuite.BeforeSuiteHooks() {