fix: resolve test environment loading race condition in CI

- Move getTestConfig() calls from module level to test execution time
- Add CI-specific debug logging to diagnose environment loading issues
- Add verification step in CI workflow to check .env.test availability
- Ensure environment variables are loaded before tests access config

The issue was that config was being accessed at module import time,
which could happen before the global setup runs in some CI environments.
This commit is contained in:
czlonkowski
2025-07-29 07:13:37 +02:00
parent 6c40057cf4
commit a8c3d04c12
4 changed files with 80 additions and 30 deletions

View File

@@ -19,6 +19,15 @@ jobs:
- name: Install dependencies
run: npm ci
# Verify test environment setup
- name: Verify test environment
run: |
echo "Current directory: $(pwd)"
echo "Checking for .env.test file:"
ls -la .env.test || echo ".env.test not found!"
echo "First few lines of .env.test:"
head -5 .env.test || echo "Cannot read .env.test"
# Run tests with coverage and multiple reporters
- name: Run tests with coverage
run: npm run test:ci