🐛 fix(ci): enable BDD_SCHEMA_ISOLATION to prevent flaky AuthBDD failures #26

Merged
arcodange merged 1 commits from fix/ci-bdd-schema-isolation into main 2026-05-03 13:52:05 +02:00
Owner

Summary

CI was failing intermittently on AuthBDD scenarios due to test state pollution. ADR-0025 (per-scenario schema isolation) is fully implemented but opt-in via BDD_SCHEMA_ISOLATION=true. CI didn't set this flag.

Evidence of flakiness

  • Workflow #605 → PASS on commit 0abc383
  • Workflow #606 → FAIL on the SAME commit, AuthBDD/* scenarios

Different scenarios fail in each run = classic shared-state issue.

Fix

Single line added to .gitea/workflows/ci-cd.yaml:
export BDD_SCHEMA_ISOLATION=true before the run-bdd-tests.sh invocation.

This activates the SetupScenarioSchema() / TeardownScenarioSchema() hooks already implemented in pkg/bdd/suite.go.

Out of scope

  • Making BDD_SCHEMA_ISOLATION the production default (separate decision)
  • Fixing other AuthBDD test fragilities not caused by state pollution

Test plan

  • Local BDD tests pass with and without the flag (this is just an env var change)
  • CI passes consistently after this PR (the validation)

Diagnosed during the 2026-05-03 autonomous trainer session.

## Summary CI was failing intermittently on AuthBDD scenarios due to test state pollution. ADR-0025 (per-scenario schema isolation) is fully implemented but opt-in via `BDD_SCHEMA_ISOLATION=true`. CI didn't set this flag. ## Evidence of flakiness - Workflow #605 → PASS on commit `0abc383` - Workflow #606 → FAIL on the SAME commit, AuthBDD/* scenarios Different scenarios fail in each run = classic shared-state issue. ## Fix Single line added to `.gitea/workflows/ci-cd.yaml`: `export BDD_SCHEMA_ISOLATION=true` before the `run-bdd-tests.sh` invocation. This activates the `SetupScenarioSchema()` / `TeardownScenarioSchema()` hooks already implemented in `pkg/bdd/suite.go`. ## Out of scope - Making BDD_SCHEMA_ISOLATION the production default (separate decision) - Fixing other AuthBDD test fragilities not caused by state pollution ## Test plan - [x] Local BDD tests pass with and without the flag (this is just an env var change) - [ ] CI passes consistently after this PR (the validation) Diagnosed during the 2026-05-03 autonomous trainer session.
arcodange added 1 commit 2026-05-03 13:51:52 +02:00
ADR-0025 introduces per-scenario schema isolation via the BDD_SCHEMA_ISOLATION env
var. CI was running without this flag, causing scenarios to share the public
schema and pollute each other's state.

Observed flakiness: identical code passes in workflow run #605 and fails in #606
on TestAuthBDD/User_completes_password_reset, JWT_token_validation, etc.

Per ADR-0025 audit (PR #24): schema-per-scenario infrastructure is fully
implemented but disabled by default (opt-in). Enabling it in CI should resolve
the flakiness without code changes.

Diagnosed during the autonomous trainer day (2026-05-03) after observing #605
PASS / #606 FAIL on the same SHA.

🤖 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arcodange merged commit 9b6c384eb2 into main 2026-05-03 13:52:05 +02:00
arcodange deleted branch fix/ci-bdd-schema-isolation 2026-05-03 13:52:05 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange/dance-lessons-coach#26