📝 docs: add GODOG_RANDOM_SEED documentation to BDD_TAGS.md
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 19s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m33s

This commit is contained in:
2026-04-10 17:39:02 +02:00
parent 22e211f842
commit 98a3acee36

View File

@@ -84,6 +84,43 @@ GODOG_TAGS="@jwt && ~@todo" go test ./features/...
DLC_DATABASE_HOST=localhost GODOG_TAGS="@wip" go test ./features/jwt/... DLC_DATABASE_HOST=localhost GODOG_TAGS="@wip" go test ./features/jwt/...
``` ```
### Test Randomization Control
You can control test execution order using the `GODOG_RANDOM_SEED` environment variable.
**Usage:**
```bash
# Use random test order (default)
GODOG_RANDOM_SEED="" go test ./features/
# Use fixed seed for reproducible test runs
GODOG_RANDOM_SEED=17925 go test ./features/
# Combine with tag filtering
GODOG_RANDOM_SEED=17925 GODOG_TAGS="@wip" go test ./features/
# Debug specific test failures by reproducing exact execution order
GODOG_RANDOM_SEED=17925 DLC_DATABASE_HOST=localhost go test ./features/jwt/
```
**Benefits:**
- **Reproducibility**: Same seed produces same test order
- **Debugging**: Easily reproduce failed test runs
- **CI/CD**: Set fixed seeds for consistent test execution
- **Backward compatible**: Defaults to random order when not specified
**Example from test output:**
```
30 scenarios (11 passed, 19 failed)
147 steps (104 passed, 19 failed, 24 skipped)
4.474215346s
Randomized with seed: 17925
```
To reproduce this exact test run:
```bash
GODOG_RANDOM_SEED=17925 go test ./features/
```
### Random Port Selection (Default Behavior) ### Random Port Selection (Default Behavior)
By default, BDD tests use **random ports** (10000-19999) to prevent port conflicts during parallel execution. This ensures tests can run reliably in CI/CD pipelines and when executed multiple times. By default, BDD tests use **random ports** (10000-19999) to prevent port conflicts during parallel execution. This ensures tests can run reliably in CI/CD pipelines and when executed multiple times.