From 021a7d948b49407f7341e5a7731ab755eb8e8bd8 Mon Sep 17 00:00:00 2001 From: Fabricio Ribeiro Date: Wed, 26 Nov 2025 10:42:41 +0000 Subject: [PATCH 1/2] Add proxy isolation tests for GUI installer Add block-list feature to proxy server --- tests/CLIRunner.test.js | 27 ++++++-- tests/GUIRunner.test.js | 17 ++++- tests/classes/CLITestRunner.class.js | 47 +------------- tests/classes/TestProxy.class.js | 72 ++++++++++++++++++++-- tests/scripts/CLICustomInstall.test.js | 10 +-- tests/scripts/CLIWizardInstall.test.js | 10 +-- tests/scripts/GUICustomInstall.test.js | 23 +++++++ tests/scripts/GUIOfflineInstall.test.js | 23 +++++++ tests/scripts/GUISimplifiedInstall.test.js | 29 ++++++++- tests/suites/CLI-mirrors-basic.json | 6 +- tests/suites/GUI-basic.json | 4 +- 11 files changed, 195 insertions(+), 73 deletions(-) diff --git a/tests/CLIRunner.test.js b/tests/CLIRunner.test.js index 42a038f0..83252715 100644 --- a/tests/CLIRunner.test.js +++ b/tests/CLIRunner.test.js @@ -16,7 +16,8 @@ "nonInteractive": false // Whether to prevent running in non-interactive mode (set to true if omitted) }, "deleteAfterTest": true // Whether to remove IDF installation folder and IDF tools folder after test - "testProxyMode": "block" // If the test run with local proxy to log or block internet access during test : "block", "log", false + "testProxyMode": "block" // If the test run with local proxy to log or block internet access during test : "block", "block-list", "log", false + "proxyBlockList": [] // List of domains to block when testProxyMode is set to "block-list" */ @@ -84,6 +85,7 @@ function testRun(jsonScript) { const deleteAfterTest = test.deleteAfterTest ?? true; const testProxyMode = test.testProxyMode ?? false; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, function () { this.timeout(6000000); @@ -92,6 +94,7 @@ function testRun(jsonScript) { id: `${test.id}1`, pathToEIM: pathToEIMCLI, testProxyMode, + proxyBlockList, }); runInstallVerification({ @@ -137,13 +140,23 @@ function testRun(jsonScript) { test.data.idfList && installArgs.push(`-i ${idfUpdatedList.join(",")}`); test.data.toolsMirror && - installArgs.push(`-m ${TOOLSMIRRORS[test.data.toolsMirror] || "https://github.com"}`); + installArgs.push( + `-m ${TOOLSMIRRORS[test.data.toolsMirror] || "https://github.com"}` + ); test.data.idfMirror && - installArgs.push(`--idf-mirror ${IDFMIRRORS[test.data.idfMirror] || "https://github.com"}`); + installArgs.push( + `--idf-mirror ${ + IDFMIRRORS[test.data.idfMirror] || "https://github.com" + }` + ); test.data.pypiMirror && - installArgs.push(`--pypi-mirror ${PYPIMIRRORS[test.data.pypiMirror] || "https://pypi.org/simple"}`); + installArgs.push( + `--pypi-mirror ${ + PYPIMIRRORS[test.data.pypiMirror] || "https://pypi.org/simple" + }` + ); test.data.recursive && installArgs.push(`-r ${test.data.recursive}`); @@ -152,6 +165,7 @@ function testRun(jsonScript) { const deleteAfterTest = test.deleteAfterTest ?? true; const testProxyMode = test.testProxyMode ?? false; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, function () { this.timeout(6000000); @@ -161,6 +175,7 @@ function testRun(jsonScript) { pathToEIM: pathToEIMCLI, args: installArgs, testProxyMode, + proxyBlockList, }); runInstallVerification({ @@ -193,7 +208,7 @@ function testRun(jsonScript) { : INSTALLFOLDER; const deleteAfterTest = test.deleteAfterTest ?? true; - + describe(`Test${test.id}- ${test.name} |`, function () { this.timeout(60000); @@ -215,6 +230,7 @@ function testRun(jsonScript) { //routine for offline installation test const deleteAfterTest = test.deleteAfterTest ?? true; const testProxyMode = test.testProxyMode ?? "block"; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, async function () { this.timeout(6000000); @@ -225,6 +241,7 @@ function testRun(jsonScript) { offlineIDFVersion: IDFDefaultVersion, offlinePkgName: pkgName, testProxyMode, + proxyBlockList, }); runInstallVerification({ diff --git a/tests/GUIRunner.test.js b/tests/GUIRunner.test.js index 8428825b..4ba5a874 100644 --- a/tests/GUIRunner.test.js +++ b/tests/GUIRunner.test.js @@ -14,7 +14,8 @@ "pypiMirror": "pypi_org", // Mirror to download python packages "pypi_org", "pypi_aliyun", "pypi_tsinghua", "pypi_ustc" } "deleteAfterTest": true // Whether to remove IDF installation folder and IDF tools folder after test - "testProxyMode": "block" // If the test run with local proxy to log or block internet access during test : "block", "log", false + "testProxyMode": "block" // If the test run with local proxy to log or block internet access during test : "block", "block-list", "log", false + "proxyBlockList": [] // List of domains to block when testProxyMode is set to "block-list" */ @@ -69,11 +70,15 @@ function testRun(script) { //routine for default simplified installation const deleteAfterTest = test.deleteAfterTest ?? true; + const testProxyMode = test.testProxyMode ?? false; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, function () { runGUISimplifiedInstallTest({ id: `${test.id}1`, pathToEIM: pathToEIMGUI, + testProxyMode, + proxyBlockList, }); runGUIAfterInstallTest({ @@ -122,6 +127,8 @@ function testRun(script) { const pypiMirror = test.data.pypiMirror || "pypi_org"; const deleteAfterTest = test.deleteAfterTest ?? true; + const testProxyMode = test.testProxyMode ?? false; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, function () { runGUICustomInstallTest({ @@ -133,6 +140,8 @@ function testRun(script) { toolsMirror, idfMirror, pypiMirror, + testProxyMode, + proxyBlockList, }); runGUIAfterInstallTest({ @@ -170,7 +179,7 @@ function testRun(script) { ? path.join(os.homedir(), test.data.installFolder) : INSTALLFOLDER; const deleteAfterTest = test.deleteAfterTest ?? true; - + describe(`Test${test.id}- ${test.name} |`, function () { this.timeout(60000); @@ -196,6 +205,8 @@ function testRun(script) { : INSTALLFOLDER; const deleteAfterTest = test.deleteAfterTest ?? true; + const testProxyMode = test.testProxyMode ?? "block"; + const proxyBlockList = test.proxyBlockList ?? []; describe(`Test${test.id}- ${test.name} |`, function () { this.timeout(6000000); @@ -205,6 +216,8 @@ function testRun(script) { pathToEIM: pathToEIMGUI, offlineIDFVersion: IDFDefaultVersion, offlinePkgName: pkgName, + testProxyMode, + proxyBlockList, }); runGUIAfterInstallTest({ diff --git a/tests/classes/CLITestRunner.class.js b/tests/classes/CLITestRunner.class.js index da4a63c0..2f0b14af 100644 --- a/tests/classes/CLITestRunner.class.js +++ b/tests/classes/CLITestRunner.class.js @@ -44,56 +44,11 @@ class CLITestRunner { } } - // Create isolated environment for network blocking - createIsolatedEnvironment() { - const proxyUrl = "http://127.0.0.1:8888"; - - // Set proxy environment variables to a monitoring server - this.environment.HTTP_PROXY = proxyUrl; - this.environment.HTTPS_PROXY = proxyUrl; - this.environment.http_proxy = proxyUrl; - this.environment.https_proxy = proxyUrl; - this.environment.FTP_PROXY = proxyUrl; - this.environment.ftp_proxy = proxyUrl; - this.environment.NO_PROXY = ""; - this.environment.no_proxy = ""; - - // Additional environment variables that some tools respect - this.environment.REQUESTS_CA_BUNDLE = ""; // Disable SSL certificates for Python requests - this.environment.CURL_CA_BUNDLE = ""; // Disable SSL certificates for curl - this.environment.SSL_CERT_FILE = ""; // Disable SSL certificates - this.environment.SSL_CERT_DIR = ""; // Disable SSL certificates - - // Rust/Cargo specific - this.environment.CARGO_HTTP_PROXY = proxyUrl; - this.environment.CARGO_HTTPS_PROXY = proxyUrl; - - // Git specific - this.environment.GIT_PROXY_COMMAND = ""; - - // Node.js specific - this.environment.npm_config_proxy = proxyUrl; - this.environment.npm_config_https_proxy = proxyUrl; - - // Python pip specific - this.environment.PIP_PROXY = proxyUrl; - - logger.debug("Network isolation environment variables set"); - } - - async start({ - command = this.command, - fullArgs = this.args, - isolatedEnvironment = false, - } = {}) { + async start({ command = this.command, fullArgs = this.args } = {}) { logger.debug( `Starting terminal emulator ${this.command} with args ${this.args}` ); - if (isolatedEnvironment) { - this.createIsolatedEnvironment(); - } - this.process = pty.spawn(command, fullArgs, { name: "eim-terminal", cols: 80, diff --git a/tests/classes/TestProxy.class.js b/tests/classes/TestProxy.class.js index 6718a1e9..1c263f02 100644 --- a/tests/classes/TestProxy.class.js +++ b/tests/classes/TestProxy.class.js @@ -4,18 +4,51 @@ import net from "net"; import url from "url"; class TestProxy { - constructor({ mode = "log" } = {}) { + constructor({ mode = "log", blockedDomains = [] } = {}) { this.port = 8888; this.host = "127.0.0.1"; - this.mode = mode; + this.mode = mode; // "log", "block" or "block-list" this.attempts = []; this.server = null; + this.blockedDomains = blockedDomains.map((domain) => domain.toLowerCase()); + } + + matchesBlocked(hostname) { + if (!hostname) return false; + const host = hostname.toLowerCase(); + return this.blockedDomains.some( + (d) => host === d || host.endsWith("." + d) + ); + } + + setEnvironment() { + logger.info("Setting proxy environment variables"); + const proxyUrl = "http://127.0.0.1:8888"; + let environment = { ...process.env }; + environment.HTTP_PROXY = proxyUrl; + environment.HTTPS_PROXY = proxyUrl; + environment.http_proxy = proxyUrl; + environment.https_proxy = proxyUrl; + environment.FTP_PROXY = proxyUrl; + environment.ftp_proxy = proxyUrl; + environment.NO_PROXY = "127.0.0.1,localhost,::1"; + environment.no_proxy = "127.0.0.1,localhost,::1"; + environment.CARGO_HTTP_PROXY = proxyUrl; + environment.CARGO_HTTPS_PROXY = proxyUrl; + environment.GIT_PROXY_COMMAND = ""; + environment.npm_config_proxy = proxyUrl; + environment.npm_config_https_proxy = proxyUrl; + environment.PIP_PROXY = proxyUrl; + process.env = { ...environment }; } async start() { + if (this.server) { + logger.info("Proxy server already running"); + return; + } logger.info(`Starting proxy server with mode ${this.mode}`); - if (this.server) return; - + this.setEnvironment(); this.server = http.createServer((req, res) => { this.attempts.push({ type: "http", method: req.method, url: req.url }); logger.info(`New HTTP connection attempt: ${req.url}`); @@ -26,7 +59,6 @@ class TestProxy { logger.debug("HTTP Connection blocked"); return; } - const hostHeader = req.headers["host"]; let hostname, port; @@ -40,6 +72,19 @@ class TestProxy { port = port || 80; } + if (this.mode === "block-list" && this.matchesBlocked(hostname)) { + this.attempts.push({ + type: "http", + method: req.method, + url: req.url, + blocked: true, + }); + res.writeHead(503, { "Content-Type": "text/plain" }); + res.end("Blocked by test proxy (domain block-list)"); + logger.debug(`HTTP Connection to ${hostname} blocked by domain list`); + return; + } + const options = { hostname, port, @@ -48,6 +93,9 @@ class TestProxy { headers: req.headers, }; + logger.info(`Proxying request to ${hostname}:${port}${req.url}`); + logger.info(options); + const proxyReq = http.request(options, (proxyRes) => { res.writeHead(proxyRes.statusCode, proxyRes.headers); proxyRes.pipe(res); @@ -56,6 +104,7 @@ class TestProxy { req.pipe(proxyReq); proxyReq.on("error", (err) => { + logger.info("HTTP Proxy request error:", err); res.writeHead(500); res.end("Proxy error: " + err.message); }); @@ -74,6 +123,16 @@ class TestProxy { } const [host, port] = req.url.split(":"); + + if (this.mode === "block-list" && this.matchesBlocked(host)) { + this.attempts.push({ type: "https", host, blocked: true }); + logger.info(`HTTPS Connection to ${host} blocked by domain list`); + clientSocket.write("HTTP/1.1 503 Service Unavailable\r\n\r\n"); + clientSocket.end(); + return; + } + logger.info(`Proxying CONNECT to ${host}:${port}`); + const serverSocket = net.connect(port || 443, host, () => { clientSocket.write("HTTP/1.1 200 Connection Established\r\n\r\n"); serverSocket.write(head); @@ -81,7 +140,8 @@ class TestProxy { clientSocket.pipe(serverSocket); }); - serverSocket.on("error", () => { + serverSocket.on("error", (err) => { + logger.info("HTTPS Connection error:", err); clientSocket.write("HTTP/1.1 500 Connection error\r\n\r\n"); clientSocket.end(); }); diff --git a/tests/scripts/CLICustomInstall.test.js b/tests/scripts/CLICustomInstall.test.js index 35275ca1..d1487312 100644 --- a/tests/scripts/CLICustomInstall.test.js +++ b/tests/scripts/CLICustomInstall.test.js @@ -13,6 +13,7 @@ export function runCLICustomInstallTest({ offlineIDFVersion = null, offlinePkgName = null, testProxyMode = false, + proxyBlockList = [], }) { describe(`${id}- Run custom |`, function () { let testRunner = null; @@ -35,7 +36,10 @@ export function runCLICustomInstallTest({ } if (testProxyMode) { try { - proxy = new TestProxy({ mode: testProxyMode }); + proxy = new TestProxy({ + mode: testProxyMode, + blockedDomains: proxyBlockList, + }); await proxy.start(); } catch (error) { logger.info("Error to start proxy server"); @@ -43,9 +47,7 @@ export function runCLICustomInstallTest({ } } try { - await testRunner.start({ - isolatedEnvironment: testProxyMode === false ? false : true, - }); + await testRunner.start(); } catch (error) { logger.info("Error to start terminal"); logger.debug(`Error: ${error}`); diff --git a/tests/scripts/CLIWizardInstall.test.js b/tests/scripts/CLIWizardInstall.test.js index 8d06a7c0..5cc56f19 100644 --- a/tests/scripts/CLIWizardInstall.test.js +++ b/tests/scripts/CLIWizardInstall.test.js @@ -18,6 +18,7 @@ export function runCLIWizardInstallTest({ id = 0, pathToEIM, testProxyMode = false, + proxyBlockList = [], }) { describe(`${id}- Run wizard |`, function () { let testRunner = null; @@ -30,7 +31,10 @@ export function runCLIWizardInstallTest({ testRunner = new CLITestRunner(); if (testProxyMode) { try { - proxy = new TestProxy({ mode: testProxyMode }); + proxy = new TestProxy({ + mode: testProxyMode, + blockedDomains: proxyBlockList, + }); await proxy.start(); } catch (error) { logger.info("Error to start proxy server"); @@ -38,9 +42,7 @@ export function runCLIWizardInstallTest({ } } try { - await testRunner.start({ - isolatedEnvironment: testProxyMode === false ? false : true, - }); + await testRunner.start(); } catch (error) { logger.info("Error to start terminal"); logger.debug(`Error: ${error}`); diff --git a/tests/scripts/GUICustomInstall.test.js b/tests/scripts/GUICustomInstall.test.js index 3cdb2070..0722072d 100644 --- a/tests/scripts/GUICustomInstall.test.js +++ b/tests/scripts/GUICustomInstall.test.js @@ -21,14 +21,29 @@ export function runGUICustomInstallTest({ toolsMirror, idfMirror, pypiMirror, + testProxyMode = false, + proxyBlockList = [], }) { describe(`${id}- Run expert mode |`, () => { let eimRunner = null; let customInstallFailed = false; + let proxy = null; before(async function () { this.timeout(60000); eimRunner = new GUITestRunner(pathToEIM); + if (testProxyMode) { + try { + proxy = new TestProxy({ + mode: testProxyMode, + blockedDomains: proxyBlockList, + }); + await proxy.start(); + } catch (error) { + logger.info("Error to start proxy server"); + logger.debug(`Error: ${error}`); + } + } try { await eimRunner.start(); } catch (err) { @@ -60,6 +75,14 @@ export function runGUICustomInstallTest({ } catch (error) { logger.info("Error to close EIM application"); } + if (testProxyMode) { + try { + await proxy.stop(); + } catch (error) { + logger.info("Error stopping proxy server"); + logger.info(`${error}`); + } + } }); it("01- Should show welcome page", async function () { diff --git a/tests/scripts/GUIOfflineInstall.test.js b/tests/scripts/GUIOfflineInstall.test.js index c13eb914..628d7da8 100644 --- a/tests/scripts/GUIOfflineInstall.test.js +++ b/tests/scripts/GUIOfflineInstall.test.js @@ -13,11 +13,14 @@ export function runGUIOfflineInstallTest({ pathToEIM, offlineIDFVersion, offlinePkgName, + testProxyMode = false, + proxyBlockList = [], }) { describe(`${id}- Run offline installation |`, () => { let eimRunner = null; let offlineInstallFailed = false; let pathToOfflineArchive = null; + let proxy = null; before(async function () { this.timeout(900000); @@ -26,6 +29,18 @@ export function runGUIOfflineInstallTest({ idfVersion: offlineIDFVersion, packageName: offlinePkgName, }); + if (testProxyMode) { + try { + proxy = new TestProxy({ + mode: testProxyMode, + blockedDomains: proxyBlockList, + }); + await proxy.start(); + } catch (error) { + logger.info("Error to start proxy server"); + logger.debug(`Error: ${error}`); + } + } try { await eimRunner.start(); } catch (err) { @@ -55,6 +70,14 @@ export function runGUIOfflineInstallTest({ } catch (error) { logger.info("Error to close EIM application"); } + if (testProxyMode) { + try { + await proxy.stop(); + } catch (error) { + logger.info("Error stopping proxy server"); + logger.info(`${error}`); + } + } if (pathToOfflineArchive) { try { fs.rmSync(pathToOfflineArchive, { force: true }); diff --git a/tests/scripts/GUISimplifiedInstall.test.js b/tests/scripts/GUISimplifiedInstall.test.js index 97be3886..56225661 100644 --- a/tests/scripts/GUISimplifiedInstall.test.js +++ b/tests/scripts/GUISimplifiedInstall.test.js @@ -3,15 +3,32 @@ import { describe, it, before, after, afterEach } from "mocha"; import GUITestRunner from "../classes/GUITestRunner.class.js"; import logger from "../classes/logger.class.js"; -export function runGUISimplifiedInstallTest({ id = 0, pathToEIM }) { - +export function runGUISimplifiedInstallTest({ + id = 0, + pathToEIM, + testProxyMode = false, + proxyBlockList = [], +}) { describe("1- Run simplified mode", () => { let eimRunner = null; let simplifiedInstallFailed = false; + let proxy = null; before(async function () { this.timeout(60000); eimRunner = new GUITestRunner(pathToEIM); + if (testProxyMode) { + try { + proxy = new TestProxy({ + mode: testProxyMode, + blockedDomains: proxyBlockList, + }); + await proxy.start(); + } catch (error) { + logger.info("Error to start proxy server"); + logger.debug(`Error: ${error}`); + } + } try { await eimRunner.start(); } catch (err) { @@ -41,6 +58,14 @@ export function runGUISimplifiedInstallTest({ id = 0, pathToEIM }) { } catch (error) { logger.info("Error to close EIM application"); } + if (testProxyMode) { + try { + await proxy.stop(); + } catch (error) { + logger.info("Error stopping proxy server"); + logger.info(`${error}`); + } + } }); it("1- Should show welcome page", async function () { diff --git a/tests/suites/CLI-mirrors-basic.json b/tests/suites/CLI-mirrors-basic.json index c07fe305..0c7492f5 100644 --- a/tests/suites/CLI-mirrors-basic.json +++ b/tests/suites/CLI-mirrors-basic.json @@ -12,7 +12,8 @@ "nonInteractive": true }, "deleteAfterTest": true, - "testProxyMode": false + "testProxyMode": "block-list", + "proxyBlockList": ["github.com"] }, { "id": 2, @@ -27,6 +28,7 @@ "nonInteractive": true }, "deleteAfterTest": true, - "testProxyMode": false + "testProxyMode": "block-list", + "proxyBlockList": ["github.com"] } ] diff --git a/tests/suites/GUI-basic.json b/tests/suites/GUI-basic.json index 70484fcd..bd621d0e 100644 --- a/tests/suites/GUI-basic.json +++ b/tests/suites/GUI-basic.json @@ -34,7 +34,7 @@ "deleteAfterTest": false, "testProxyMode": false }, - { + { "id": 5, "type": "version-management", "name": "GUI Version Management", @@ -49,6 +49,6 @@ "name": "GUI Offline Installation", "data": {}, "deleteAfterTest": true, - "testProxyMode": false + "testProxyMode": "block" } ] From 560f5f645e976081db607625a68c37936708d000 Mon Sep 17 00:00:00 2001 From: Fabricio Ribeiro Date: Fri, 28 Nov 2025 10:22:55 +0000 Subject: [PATCH 2/2] Fix proxy import and environment handling --- tests/classes/CLITestRunner.class.js | 3 +-- tests/classes/TestProxy.class.js | 30 ++++++++++------------ tests/scripts/GUICustomInstall.test.js | 1 + tests/scripts/GUIOfflineInstall.test.js | 1 + tests/scripts/GUISimplifiedInstall.test.js | 1 + 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/classes/CLITestRunner.class.js b/tests/classes/CLITestRunner.class.js index 2f0b14af..0b43d0f7 100644 --- a/tests/classes/CLITestRunner.class.js +++ b/tests/classes/CLITestRunner.class.js @@ -17,7 +17,6 @@ class CLITestRunner { os.platform() !== "win32" ? [] : ["-ExecutionPolicy", "Bypass", "-NoProfile"]; - this.environment = { ...process.env }; } async runIDFTerminal(loadScript, timeout = 3000) { @@ -54,7 +53,7 @@ class CLITestRunner { cols: 80, rows: 30, cwd: process.cwd(), - env: this.environment, + env: process.env, }); this.exited = false; diff --git a/tests/classes/TestProxy.class.js b/tests/classes/TestProxy.class.js index 1c263f02..bc5204d5 100644 --- a/tests/classes/TestProxy.class.js +++ b/tests/classes/TestProxy.class.js @@ -24,22 +24,20 @@ class TestProxy { setEnvironment() { logger.info("Setting proxy environment variables"); const proxyUrl = "http://127.0.0.1:8888"; - let environment = { ...process.env }; - environment.HTTP_PROXY = proxyUrl; - environment.HTTPS_PROXY = proxyUrl; - environment.http_proxy = proxyUrl; - environment.https_proxy = proxyUrl; - environment.FTP_PROXY = proxyUrl; - environment.ftp_proxy = proxyUrl; - environment.NO_PROXY = "127.0.0.1,localhost,::1"; - environment.no_proxy = "127.0.0.1,localhost,::1"; - environment.CARGO_HTTP_PROXY = proxyUrl; - environment.CARGO_HTTPS_PROXY = proxyUrl; - environment.GIT_PROXY_COMMAND = ""; - environment.npm_config_proxy = proxyUrl; - environment.npm_config_https_proxy = proxyUrl; - environment.PIP_PROXY = proxyUrl; - process.env = { ...environment }; + process.env.HTTP_PROXY = proxyUrl; + process.env.HTTPS_PROXY = proxyUrl; + process.env.http_proxy = proxyUrl; + process.env.https_proxy = proxyUrl; + process.env.FTP_PROXY = proxyUrl; + process.env.ftp_proxy = proxyUrl; + process.env.NO_PROXY = "127.0.0.1,localhost,::1"; + process.env.no_proxy = "127.0.0.1,localhost,::1"; + process.env.CARGO_HTTP_PROXY = proxyUrl; + process.env.CARGO_HTTPS_PROXY = proxyUrl; + process.env.GIT_PROXY_COMMAND = ""; + process.env.npm_config_proxy = proxyUrl; + process.env.npm_config_https_proxy = proxyUrl; + process.env.PIP_PROXY = proxyUrl; } async start() { diff --git a/tests/scripts/GUICustomInstall.test.js b/tests/scripts/GUICustomInstall.test.js index 0722072d..16ce5928 100644 --- a/tests/scripts/GUICustomInstall.test.js +++ b/tests/scripts/GUICustomInstall.test.js @@ -2,6 +2,7 @@ import { expect } from "chai"; import { describe, it, before, after, afterEach } from "mocha"; import { By, Key } from "selenium-webdriver"; import GUITestRunner from "../classes/GUITestRunner.class.js"; +import TestProxy from "../classes/TestProxy.class.js"; import { IDFMIRRORS, TOOLSMIRRORS, diff --git a/tests/scripts/GUIOfflineInstall.test.js b/tests/scripts/GUIOfflineInstall.test.js index 628d7da8..2b4f7390 100644 --- a/tests/scripts/GUIOfflineInstall.test.js +++ b/tests/scripts/GUIOfflineInstall.test.js @@ -1,6 +1,7 @@ import { expect } from "chai"; import { describe, it, before, after, afterEach } from "mocha"; import GUITestRunner from "../classes/GUITestRunner.class.js"; +import TestProxy from "../classes/TestProxy.class.js"; import { downloadOfflineArchive } from "../helper.js"; import logger from "../classes/logger.class.js"; import { By } from "selenium-webdriver"; diff --git a/tests/scripts/GUISimplifiedInstall.test.js b/tests/scripts/GUISimplifiedInstall.test.js index 56225661..dde39b08 100644 --- a/tests/scripts/GUISimplifiedInstall.test.js +++ b/tests/scripts/GUISimplifiedInstall.test.js @@ -1,6 +1,7 @@ import { expect } from "chai"; import { describe, it, before, after, afterEach } from "mocha"; import GUITestRunner from "../classes/GUITestRunner.class.js"; +import TestProxy from "../classes/TestProxy.class.js"; import logger from "../classes/logger.class.js"; export function runGUISimplifiedInstallTest({