🧪 test: implement comprehensive BDD test suite for JWT secret rotation
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 11s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m23s

- Added JWT secret rotation feature tests
- Implemented config management BDD steps
- Created greet service BDD scenarios
- Enhanced test server with JWT rotation support
- Added comprehensive step definitions

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-09 22:51:19 +02:00
parent e7c6154eab
commit 5c8f42b33f
5 changed files with 303 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import (
"dance-lessons-coach/pkg/bdd/testserver"
"github.com/cucumber/godog"
"github.com/rs/zerolog/log"
)
// StepContext holds the test client and implements all step definitions
@@ -30,6 +31,16 @@ func NewStepContext(client *testserver.Client) *StepContext {
}
}
// CleanupAllTestConfigFiles cleans up any test config files created during tests
func CleanupAllTestConfigFiles() error {
// Cleanup config hot reloading test file
configSteps := &ConfigSteps{configFilePath: "test-config.yaml"}
if err := configSteps.CleanupTestConfigFile(); err != nil {
log.Warn().Err(err).Msg("Failed to cleanup config test file")
}
return nil
}
// InitializeAllSteps registers all step definitions for the BDD tests
func InitializeAllSteps(ctx *godog.ScenarioContext, client *testserver.Client) {
sc := NewStepContext(client)