- Add GODOG_STOP_ON_FAILURE environment variable to all test suites - Maintain feature-specific defaults for stop on failure behavior - JWT, Greet, Auth, Health: stop on failure by default (true) - Config, All Features: continue after failures by default (false) - Allow runtime override via environment variable - Update BDD_TAGS.md with usage examples and defaults - Support boolean values: true, false, 1, 0 Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistralai.com>
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"dance-lessons-coach/pkg/bdd"
|
|
|
|
"github.com/cucumber/godog"
|
|
)
|
|
|
|
func TestConfigBDD(t *testing.T) {
|
|
// Set FEATURE environment variable for feature-specific configuration
|
|
os.Setenv("FEATURE", "config")
|
|
|
|
// Allow tag override via environment variable
|
|
tags := os.Getenv("GODOG_TAGS")
|
|
if tags == "" {
|
|
// Default tags if not overridden
|
|
tags = "~@flaky && ~@todo && ~@skip"
|
|
}
|
|
|
|
// Allow stop on failure override via environment variable
|
|
stopOnFailure := false // Default for config tests (don't stop on failure)
|
|
if envStop := os.Getenv("GODOG_STOP_ON_FAILURE"); envStop != "" {
|
|
stopOnFailure = envStop == "true" || envStop == "1"
|
|
}
|
|
|
|
suite := godog.TestSuite{
|
|
Name: "dance-lessons-coach BDD Tests - Config Feature",
|
|
TestSuiteInitializer: bdd.InitializeTestSuite,
|
|
ScenarioInitializer: bdd.InitializeScenario,
|
|
Options: &godog.Options{
|
|
Format: "progress",
|
|
Paths: []string{"."},
|
|
TestingT: t,
|
|
Strict: true,
|
|
Randomize: -1,
|
|
StopOnFailure: stopOnFailure,
|
|
Tags: tags,
|
|
},
|
|
}
|
|
|
|
if suite.Run() != 0 {
|
|
t.Fatal("non-zero status returned, failed to run config BDD tests")
|
|
}
|
|
}
|