Commit b533d0d
Krsna Suraj
test_runner: capture process state in entry point instead of runner
The run() function in the test runner directly accesses process.execArgv,
process.cwd(), and process.env to configure child processes. This is
problematic because run() is part of the public API and should not depend
on ambient process state.
This commit moves those reads to the CLI entry point (test_runner.js) and
passes them as explicit options to run():
- main/test_runner.js: capture process.execArgv, process.env, process.cwd()
- runner.js getRunArgs(): use execArgv parameter instead of process.execArgv
- runner.js run(): default env to process.env for backward compat
- runner.js runTestFile(): remove process.env fallback (handled by run())
- runner.js run(): check env.NODE_TEST_CONTEXT for recursive run detection
Refs: #538671 parent 7c53fb5 commit b533d0d
2 files changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
500 | 501 | | |
501 | 502 | | |
502 | 503 | | |
503 | | - | |
| 504 | + | |
504 | 505 | | |
505 | 506 | | |
506 | 507 | | |
| |||
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
735 | | - | |
| 736 | + | |
736 | 737 | | |
737 | 738 | | |
738 | 739 | | |
| |||
907 | 908 | | |
908 | 909 | | |
909 | 910 | | |
910 | | - | |
| 911 | + | |
911 | 912 | | |
912 | 913 | | |
913 | 914 | | |
| |||
997 | 998 | | |
998 | 999 | | |
999 | 1000 | | |
1000 | | - | |
| 1001 | + | |
1001 | 1002 | | |
1002 | 1003 | | |
1003 | 1004 | | |
| |||
0 commit comments