PR #26 added BDD_SCHEMA_ISOLATION=true to CI but this creates per-scenario schemas
WITHOUT running migrations on them, causing 500 errors on user registration. This
PR reverts that and instead relies on:
1. The existing CleanupDatabase hook (truncates all tables AfterScenario)
2. Sequential test package execution (-p 1) to avoid contention between feature
packages sharing the same Postgres DB
Plus defensive additions for future-proofing:
- pkg/server/server.go: GetCacheService() exposed for test cleanup
- pkg/bdd/testserver/server.go: cacheService field + FlushCache() method
- pkg/bdd/testserver/state_tracer.go: TraceStateCacheOperation
- pkg/bdd/suite.go: AfterScenario hook calls FlushCache()
- scripts/run-bdd-tests.sh: -p 1 added (sequential package execution)
Validation:
- AuthBDD alone: 5/5 PASS (was 0/5 with broken schema isolation)
- Full features/ via run-bdd-tests.sh: ALL PASS (auth, config, greet, health, jwt)
Out of scope (follow-up T12):
- Proper parallel BDD with schema migrations per scenario + dedicated connection
pools. Required for scaling tests but architecturally significant. Tracked.
Co-Authored-By: Mistral Vibe (devstral-2 / mistral-medium-3.5) - cache flush diagnosis
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> - root cause + revert
- Add swag fmt to git pre-commit hook and CI/CD pipeline
- Create comprehensive CONTRIBUTING.md guide with AI section
- Update ADR-0013 with swag fmt documentation
- Fix swagger generation to include all endpoints
- Improve local testing scripts and workflows
- Update Dockerfile for better swagger handling
- Fix CI/CD workflow file references
- Add ADR-0012 documenting the decision to format only staged Go files
- Update ADR README.md with new entry
- Document rationale, alternatives, and verification results
- Include future considerations for monitoring and CI/CD integration
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Added /api/v2/greet POST endpoint with JSON request/response
- Implemented ServiceV2 with Hello my friend <name>! greeting format
- Added api.v2_enabled feature flag (default: false)
- Extended BDD tests to cover v2 scenarios
- Maintained full backward compatibility with v1 API
- Added DLC_API_V2_ENABLED environment variable support
- Created ADR 0010-api-v2-feature-flag.md
- Updated configuration system to support API versioning
Implement comprehensive BDD testing framework using Godog:
- Added feature files for greet and health endpoints
- Created test server that runs on port 9191
- Implemented step definitions using Godog's exact patterns
- Fixed undefined step warnings by following Godog conventions
- All tests passing with proper response validation
- Maintained black box testing principles
Key files:
- pkg/bdd/steps/steps.go - Step definitions using StepContext struct
- pkg/bdd/testserver/ - Test server implementation
- features/*.feature - BDD feature files
- pkg/bdd/README.md - Documentation for proper step patterns
The implementation follows Godog's exact pattern suggestions to avoid
undefined step warnings and provides comprehensive API testing.