Commit c8662ac
committed
Fix e2e test skip logic for undefined ADO pipeline variables
When a pipeline variable referenced in a step env: block is not defined,
ADO injects the literal string '' into the process environment
instead of an empty value. That literal is truthy, so plain os.getenv()
guards fail to skip and tests error trying to open '' as a path.
Fix: add _clean_env() helper in both lab_config.py and test_e2e.py that
returns None for unset values AND for ADO-literal '' strings.
- lab_config.py: _get_credential() and get_client_certificate() use _clean_env()
- test_e2e.py: get_lab_app() uses _clean_env(); PublicCloudScenariosTestCase
setUpClass() guard uses _clean_env()
This makes all LabBasedTestCase and PublicCloudScenariosTestCase tests skip
cleanly (rather than error) when LAB_APP_CLIENT_ID is not configured as a
pipeline variable.1 parent 66a42f1 commit c8662ac
2 files changed
+31
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
167 | 182 | | |
168 | 183 | | |
169 | 184 | | |
| |||
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
180 | | - | |
181 | | - | |
| 195 | + | |
| 196 | + | |
182 | 197 | | |
183 | 198 | | |
184 | 199 | | |
| |||
396 | 411 | | |
397 | 412 | | |
398 | 413 | | |
399 | | - | |
| 414 | + | |
400 | 415 | | |
401 | 416 | | |
402 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
348 | | - | |
| 356 | + | |
349 | 357 | | |
350 | 358 | | |
351 | 359 | | |
| |||
473 | 481 | | |
474 | 482 | | |
475 | 483 | | |
476 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
477 | 487 | | |
478 | | - | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
482 | | - | |
| 491 | + | |
483 | 492 | | |
484 | 493 | | |
485 | 494 | | |
| |||
0 commit comments