Skip to content

Commit 560f5f6

Browse files
committed
Fix proxy import and environment handling
1 parent 021a7d9 commit 560f5f6

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

tests/classes/CLITestRunner.class.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class CLITestRunner {
1717
os.platform() !== "win32"
1818
? []
1919
: ["-ExecutionPolicy", "Bypass", "-NoProfile"];
20-
this.environment = { ...process.env };
2120
}
2221

2322
async runIDFTerminal(loadScript, timeout = 3000) {
@@ -54,7 +53,7 @@ class CLITestRunner {
5453
cols: 80,
5554
rows: 30,
5655
cwd: process.cwd(),
57-
env: this.environment,
56+
env: process.env,
5857
});
5958
this.exited = false;
6059

tests/classes/TestProxy.class.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ class TestProxy {
2424
setEnvironment() {
2525
logger.info("Setting proxy environment variables");
2626
const proxyUrl = "http://127.0.0.1:8888";
27-
let environment = { ...process.env };
28-
environment.HTTP_PROXY = proxyUrl;
29-
environment.HTTPS_PROXY = proxyUrl;
30-
environment.http_proxy = proxyUrl;
31-
environment.https_proxy = proxyUrl;
32-
environment.FTP_PROXY = proxyUrl;
33-
environment.ftp_proxy = proxyUrl;
34-
environment.NO_PROXY = "127.0.0.1,localhost,::1";
35-
environment.no_proxy = "127.0.0.1,localhost,::1";
36-
environment.CARGO_HTTP_PROXY = proxyUrl;
37-
environment.CARGO_HTTPS_PROXY = proxyUrl;
38-
environment.GIT_PROXY_COMMAND = "";
39-
environment.npm_config_proxy = proxyUrl;
40-
environment.npm_config_https_proxy = proxyUrl;
41-
environment.PIP_PROXY = proxyUrl;
42-
process.env = { ...environment };
27+
process.env.HTTP_PROXY = proxyUrl;
28+
process.env.HTTPS_PROXY = proxyUrl;
29+
process.env.http_proxy = proxyUrl;
30+
process.env.https_proxy = proxyUrl;
31+
process.env.FTP_PROXY = proxyUrl;
32+
process.env.ftp_proxy = proxyUrl;
33+
process.env.NO_PROXY = "127.0.0.1,localhost,::1";
34+
process.env.no_proxy = "127.0.0.1,localhost,::1";
35+
process.env.CARGO_HTTP_PROXY = proxyUrl;
36+
process.env.CARGO_HTTPS_PROXY = proxyUrl;
37+
process.env.GIT_PROXY_COMMAND = "";
38+
process.env.npm_config_proxy = proxyUrl;
39+
process.env.npm_config_https_proxy = proxyUrl;
40+
process.env.PIP_PROXY = proxyUrl;
4341
}
4442

4543
async start() {

tests/scripts/GUICustomInstall.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { expect } from "chai";
22
import { describe, it, before, after, afterEach } from "mocha";
33
import { By, Key } from "selenium-webdriver";
44
import GUITestRunner from "../classes/GUITestRunner.class.js";
5+
import TestProxy from "../classes/TestProxy.class.js";
56
import {
67
IDFMIRRORS,
78
TOOLSMIRRORS,

tests/scripts/GUIOfflineInstall.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect } from "chai";
22
import { describe, it, before, after, afterEach } from "mocha";
33
import GUITestRunner from "../classes/GUITestRunner.class.js";
4+
import TestProxy from "../classes/TestProxy.class.js";
45
import { downloadOfflineArchive } from "../helper.js";
56
import logger from "../classes/logger.class.js";
67
import { By } from "selenium-webdriver";

tests/scripts/GUISimplifiedInstall.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect } from "chai";
22
import { describe, it, before, after, afterEach } from "mocha";
33
import GUITestRunner from "../classes/GUITestRunner.class.js";
4+
import TestProxy from "../classes/TestProxy.class.js";
45
import logger from "../classes/logger.class.js";
56

67
export function runGUISimplifiedInstallTest({

0 commit comments

Comments
 (0)