-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreverseproxy_module_bdd_test.go
More file actions
39 lines (33 loc) · 1.03 KB
/
reverseproxy_module_bdd_test.go
File metadata and controls
39 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package reverseproxy
import (
"testing"
"github.com/cucumber/godog"
)
// TestReverseProxyModuleBDD runs the BDD tests for the ReverseProxy module
// This test aggregates scenarios from all the split BDD test files
func TestReverseProxyModuleBDD(t *testing.T) {
if testing.Short() {
t.Skip("Skipping BDD tests in short mode")
}
suite := godog.TestSuite{
ScenarioInitializer: func(s *godog.ScenarioContext) {
ctx := &ReverseProxyBDDTestContext{}
// CRITICAL: Reset context AFTER each scenario to ensure cleanup
// This prevents health checkers and other background goroutines from leaking
s.AfterScenario(func(*godog.Scenario, error) {
ctx.resetContext()
})
// Register all step definitions from all BDD files
registerAllStepDefinitions(s, ctx)
},
Options: &godog.Options{
Format: "pretty",
Paths: []string{"features"},
TestingT: t,
Strict: true, // fail suite on undefined or pending steps
},
}
if suite.Run() != 0 {
t.Fatal("non-zero status returned, failed to run feature tests")
}
}