Commit 0b2f0af
committed
fix: correct environment variable handling in MSSQL tests
Fixed issue where MSSQL tests were failing in GitHub Actions with
'Login failed for user testuser' error. The problem was incorrect
handling of getenv() return values.
Changes:
1. Fixed BaseMSSQLTestCase::setUpBeforeClass():
- Changed from: getenv('PDODB_USERNAME') ?: self::DB_USER
- Changed to: explicit check for false or empty string
- getenv() returns false for non-existent variables, and ?: operator
doesn't work correctly with false values
2. Fixed OptimizeCommandCliTests::setUp():
- Changed from: getenv('PDODB_USERNAME') ?: self::DB_USER
- Changed to: explicit check for false or empty string
- Ensures environment variables from GitHub Actions (sa/Test123!@#)
are properly read instead of falling back to testuser/testpass
The issue affected 18 tests that were trying to connect with
'testuser' credentials instead of 'sa' credentials provided by
GitHub Actions environment variables.
Search keywords for future debugging:
- MSSQL test login failed
- environment variable getenv false
- GitHub Actions MSSQL credentials
- PDODB_USERNAME PDODB_PASSWORD handling1 parent dd3cc0e commit 0b2f0af
File tree
2 files changed
+17
-4
lines changed- tests/mssql
2 files changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
0 commit comments