🧪 test: add JWT secret rotation BDD scenarios and step implementations #12

Merged
arcodange merged 72 commits from feature/jwt-secret-rotation into main 2026-04-11 17:56:47 +02:00
Showing only changes of commit 3dbd41b731 - Show all commits

View File

@@ -150,6 +150,14 @@ func CreateTestSuite(t *testing.T, config *FeatureConfig, suiteName string) godo
stopOnFailure, _ = strconv.ParseBool(envStop) stopOnFailure, _ = strconv.ParseBool(envStop)
} }
// Allow randomization seed override via environment variable
randomize := -1 // Default: randomize test order
if envSeed := os.Getenv("GODOG_RANDOM_SEED"); envSeed != "" {
if parsedSeed, err := strconv.Atoi(envSeed); err == nil {
randomize = parsedSeed
}
}
// Determine the correct path for feature files // Determine the correct path for feature files
// When running from within a feature directory, use "." to find feature files in current dir // When running from within a feature directory, use "." to find feature files in current dir
// When running from outside, use the feature name as a relative path // When running from outside, use the feature name as a relative path
@@ -168,7 +176,7 @@ func CreateTestSuite(t *testing.T, config *FeatureConfig, suiteName string) godo
Paths: []string{featurePath}, Paths: []string{featurePath},
TestingT: t, TestingT: t,
Strict: true, Strict: true,
Randomize: -1, Randomize: randomize,
StopOnFailure: stopOnFailure, StopOnFailure: stopOnFailure,
Tags: tags, Tags: tags,
}, },
@@ -195,6 +203,14 @@ func CreateMultiFeatureTestSuite(t *testing.T, config *MultiFeatureConfig, suite
stopOnFailure, _ = strconv.ParseBool(envStop) stopOnFailure, _ = strconv.ParseBool(envStop)
} }
// Allow randomization seed override via environment variable
randomize := -1 // Default: randomize test order
if envSeed := os.Getenv("GODOG_RANDOM_SEED"); envSeed != "" {
if parsedSeed, err := strconv.Atoi(envSeed); err == nil {
randomize = parsedSeed
}
}
return godog.TestSuite{ return godog.TestSuite{
Name: suiteName, Name: suiteName,
TestSuiteInitializer: bdd.InitializeTestSuite, TestSuiteInitializer: bdd.InitializeTestSuite,
@@ -204,7 +220,7 @@ func CreateMultiFeatureTestSuite(t *testing.T, config *MultiFeatureConfig, suite
Paths: config.Paths, Paths: config.Paths,
TestingT: t, TestingT: t,
Strict: true, Strict: true,
Randomize: -1, Randomize: randomize,
StopOnFailure: stopOnFailure, StopOnFailure: stopOnFailure,
Tags: tags, Tags: tags,
}, },