🧪 test: fix BDD step registration and update CI/CD workflow
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 17s
CI/CD Pipeline / CI Pipeline (push) Has been cancelled

- Fix step pattern escaping in pkg/bdd/steps/steps.go:80
- Update CI/CD workflow to use run-bdd-tests.sh script
- Enhance run-bdd-tests.sh for both local and CI environments
- Add strict validation for undefined/pending/skipped steps
- Update BDD testing documentation with pattern requirements

The CI/CD pipeline now properly validates BDD tests and fails on any
undefined, pending, or skipped steps. All 22 BDD scenarios are passing
with correct step pattern registration.
This commit is contained in:
2026-04-08 12:13:17 +02:00
parent f013a1771d
commit 5bfb08abc7
7 changed files with 854 additions and 51 deletions

View File

@@ -183,10 +183,24 @@ jobs:
exit 1
fi
- name: Run tests with coverage
- name: Run BDD tests with strict validation
run: |
echo "Running tests with PostgreSQL service..."
go test ./... -coverprofile=coverage.out -v && go tool cover -func=coverage.out > coverage.txt
echo "Running BDD tests with strict validation..."
# Use the run-bdd-tests.sh script which fails on undefined/pending steps
# In CI environment, PostgreSQL is already running as a service
export DLC_DATABASE_HOST=postgres
export DLC_DATABASE_PORT=5432
export DLC_DATABASE_USER=postgres
export DLC_DATABASE_PASSWORD=postgres
export DLC_DATABASE_NAME=dance_lessons_coach_bdd_test
export DLC_DATABASE_SSL_MODE=disable
./scripts/run-bdd-tests.sh
- name: Run unit tests with coverage
run: |
echo "Running unit tests with PostgreSQL service..."
# Run unit tests excluding BDD tests (already run above)
go test ./pkg/... ./cmd/... -coverprofile=coverage.out -v && go tool cover -func=coverage.out > coverage.txt
# Extract coverage percentage
COVERAGE=$(grep "total:" coverage.txt | grep -oP '\d+\.\d+' | head -1)