GeezerVison is showing github.com — test: pass process.env to child processes · nodejs/node@1ee6df9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: benchmark/_http-benchmarkers.js +3-5Lines changed: 3 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -91,11 +91,9 @@ class TestDoubleBenchmarker { | 91 | 91 | create(options) { | 92 | 92 | const child = child_process.fork(this.executable, { | 93 | 93 | silent: true, | 94 | | - env: { | 95 | | - duration: options.duration, | 96 | | - connections: options.connections, | 97 | | - path: `http://127.0.0.1:${options.port}${options.path}` | 98 | | - } | | 94 | + env: Object.assign({}, process.env, { | | 95 | + test_url: `http://127.0.0.1:${options.port}${options.path}` | | 96 | + }) | 99 | 97 | }); | 100 | 98 | return child; | 101 | 99 | } | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/_test-double-benchmarker.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 |
| 3 | 3 | const http = require('http'); | 4 | 4 |
| 5 | | -http.get(process.env.path, function() { | | 5 | +http.get(process.env.test_url, function() { | 6 | 6 | console.log(JSON.stringify({ throughput: 1 })); | 7 | 7 | }); |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-no-shell.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ const expected = common.isWindows ? '%foo%' : '$foo'; | 8 | 8 | if (process.argv[2] === undefined) { | 9 | 9 | const child = cp.fork(__filename, [expected], { | 10 | 10 | shell: true, | 11 | | - env: { foo: 'bar' } | | 11 | + env: Object.assign({}, process.env, { foo: 'bar' }) | 12 | 12 | }); | 13 | 13 |
| 14 | 14 | child.on('exit', common.mustCall((code, signal) => { | |
Collapse file Copy file name to clipboardExpand all lines: test/sequential/test-inspector-port-cluster.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -311,11 +311,11 @@ function workerProcessMain() { | 311 | 311 | function spawnMaster({ execArgv, workers, clusterSettings = {} }) { | 312 | 312 | return new Promise((resolve) => { | 313 | 313 | childProcess.fork(__filename, { | 314 | | - env: { | | 314 | + env: Object.assign({}, process.env, { | 315 | 315 | workers: JSON.stringify(workers), | 316 | 316 | clusterSettings: JSON.stringify(clusterSettings), | 317 | 317 | testProcess: true | 318 | | - }, | | 318 | + }), | 319 | 319 | execArgv | 320 | 320 | }).on('exit', common.mustCall((code, signal) => { | 321 | 321 | checkExitCode(code, signal); | |
|