Skip to content

Commit

Permalink
Only use scenario initializer for v2alpha1 tests (#1521)
Browse files Browse the repository at this point in the history
  • Loading branch information
barchw authored Dec 5, 2024
1 parent 582d89f commit ed95590
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ed95590

Please sign in to comment.