Commit Graph

12 Commits

Author SHA1 Message Date
5c8f42b33f 🧪 test: implement comprehensive BDD test suite for JWT secret rotation
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 11s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m23s
- Added JWT secret rotation feature tests
- Implemented config management BDD steps
- Created greet service BDD scenarios
- Enhanced test server with JWT rotation support
- Added comprehensive step definitions

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-09 22:51:19 +02:00
58c1dda4cf 🧪 test: add BDD scenarios for config hot reloading
Adds comprehensive BDD test scenarios for configuration hot reloading functionality:
- 10 scenarios covering hot reloading of logging level, feature flags, telemetry settings, JWT TTL
- Scenarios for handling invalid configurations, file deletion/recreation, rapid changes
- Audit logging scenarios for configuration changes
- All scenarios follow black box testing principles using actual HTTP endpoints

The scenarios are marked as pending since the hot reloading feature is not yet implemented.
They will serve as executable specifications for the future implementation.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-09 19:16:21 +02:00
168efd3e99 🧪 test: fix undefined BDD step for JWT retention period
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m11s
2026-04-09 18:06:41 +02:00
3bad64026b 🧪 test: reduce BDD undefined steps from 52 to 1
- Add missing JWT secret rotation step definitions

- Implement JWT retention policy step implementations

- Fix step pattern matching for Godog compatibility

- Add proper godog.ErrPending for unimplemented steps

- Resolve argument mismatch in step definitions

Reduces undefined steps by 98% (52 → 1)

All JWT secret rotation scenarios now have step definitions

Remaining undefined step is response validation pattern issue
2026-04-09 17:40:51 +02:00
695cd407f2 🧪 test: added tests for jwt rotation features 2026-04-09 15:44:25 +02:00
a17eebc8f2 🧪 test: add comprehensive BDD test suite for user authentication
Added BDD test scenarios covering:
- User registration with validation
- Successful and failed authentication
- Admin authentication with master password
- JWT token generation and validation
- Password reset workflow
- Edge cases and error handling

BDD Features:
- 20+ authentication scenarios
- JWT validation edge cases
- Password reset security scenarios
- Input validation tests
- Error response verification

BDD Infrastructure:
- Step definitions for authentication workflows
- Test server with user management endpoints
- JWT parsing and validation utilities
- Common step patterns for reuse

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-09 00:25:48 +02:00
157d8e2d19 🔧 chore: update all references from DanceLessonsCoach to dance-lessons-coach
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Failing after 4m0s
2026-04-06 17:27:07 +02:00
9336178d73 📝 docs: add ADR for staged-only Git hooks formatting
- 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>
2026-04-04 21:36:57 +02:00
d3b6d190d1 feat: implement input validation for API v2
- Added go-playground/validator dependency

- Created pkg/validation/ package with custom validator wrapper

- Implemented request validation for v2 greet endpoint

- Added structured validation error responses

- Extended BDD tests to cover validation scenarios

- Updated AGENTS.md with v2 API documentation

- Created ADR 0011-validation-library-selection.md

- Simplified server handler creation code

- Updated CHANGELOG with implementation details
2026-04-04 21:08:13 +02:00
875eb09fb7 feat: implement API v2 with feature flag control
- 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
2026-04-04 20:39:46 +02:00
85b6cf82ee 🧪 feat: complete BDD implementation with comprehensive documentation
Finalize BDD testing framework with:
- Unified step definitions using StepContext struct
- Proper server verification in theServerIsRunning step
- Robust JSON response handling with escaping and newline trimming
- Updated documentation reflecting current implementation
- Test validation script to ensure test quality
- All tests passing with proper black box testing

Key files updated:
- pkg/bdd/steps/steps.go: Unified step definitions
- pkg/bdd/testserver/client.go: Robust response validation
- pkg/bdd/README.md: Godog pattern guide
- doc/BDD_GUIDE.md: Updated usage guide
- adr/0008-bdd-testing.md: Updated ADR with current approach
- scripts/run-bdd-tests.sh: Test validation script

The BDD framework is now production-ready with comprehensive
documentation and proper testing practices.
2026-04-04 17:59:35 +02:00
0daaf9bf96 feat: implement BDD testing with Godog
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.
2026-04-04 17:43:57 +02:00