Commit 9778088
committed
fix: preserve PDODB_USERNAME and PDODB_PASSWORD in OptimizeCommandCliTests tearDown
Fixed issue where OptimizeCommandCliTests::tearDown() was clearing
PDODB_USERNAME and PDODB_PASSWORD environment variables, causing
subsequent tests to fail with 'Login failed for user testuser' error.
The problem occurred because:
1. OptimizeCommandCliTests runs and sets environment variables in setUp()
2. tearDown() clears all environment variables including PDODB_USERNAME/PASSWORD
3. Subsequent tests that create new connections cannot read credentials
4. They fall back to default testuser/testpass which don't exist in CI
Solution:
- Keep PDODB_USERNAME and PDODB_PASSWORD in tearDown() as they are
needed by other tests that may create new PdoDb instances
- Only clear test-specific variables (DRIVER, HOST, PORT, DATABASE)
This ensures that environment variables from GitHub Actions (sa/Test123!@#)
remain available for all tests throughout the test suite execution.1 parent 0b2f0af commit 9778088
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
0 commit comments