Skip to content

Commit 529a41c

Browse files
feat: add comprehensive scenario-based test suite
- 6 deterministic scenarios: session overflow, concurrent read/write, TTL expiry, persistence recovery, store lifecycle, hot key thundering herd - 3 randomized scenarios: mixed workload, burst writes, concurrent multi-store - Randomized tests log seed for reproducibility (SCENARIO_SEED env var) - Added to CI workflow (runs on every push) - Added to comprehensive test workflow (runs daily)
1 parent 765e278 commit 529a41c

3 files changed

Lines changed: 498 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ jobs:
8888
test-results/
8989
coverage.html
9090
91+
scenario-tests:
92+
name: Scenario Tests
93+
runs-on: ubuntu-latest
94+
needs: unit-tests
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
100+
- name: Set up Go
101+
uses: actions/setup-go@v5
102+
with:
103+
go-version: ${{ env.GO_VERSION }}
104+
105+
- name: Download dependencies
106+
run: go mod download
107+
108+
- name: Run scenario tests
109+
run: |
110+
go test -v -race -timeout=5m ./tests/scenarios/...
111+
echo "✅ Scenario tests completed"
112+
91113
integration-tests:
92114
name: Integration Tests (Newman)
93115
runs-on: ubuntu-latest

.github/workflows/test-comprehensive.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,21 @@ jobs:
109109
with:
110110
name: benchmark-results
111111
path: benchmark-results/
112+
113+
scenario-tests:
114+
name: Scenario Tests (Real-World Patterns)
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: actions/setup-go@v5
119+
with:
120+
go-version: ${{ env.GO_VERSION }}
121+
- run: go mod download
122+
- name: Run deterministic scenarios
123+
run: |
124+
go test -v -race -timeout=5m -run 'Test(SessionStoreOverflow|ConcurrentReadWrite|TTLExpiry|PersistenceRecovery|StoreLifecycle|HotKeyThunderingHerd)' \
125+
./tests/scenarios/...
126+
- name: Run randomized scenarios
127+
run: |
128+
go test -v -race -timeout=5m -run 'TestRandomized' \
129+
./tests/scenarios/...

0 commit comments

Comments
 (0)