Skip to content

Commit 9f61ff6

Browse files
authored
Merge pull request #233 from asad9711/CYP-626
CYP-626
2 parents 3743a88 + 1b88b9e commit 9f61ff6

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

commands/utils/constants.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@ module.exports = {
2727
"https://api.lambdatest.com/automation/api/v1/cypress/artefacts/test/",
2828
},
2929
beta: {
30-
INTEGRATION_BASE_URL:
31-
"https://api-cypress-v2-dev.lambdatestinternal.com/liis",
30+
INTEGRATION_BASE_URL: "https://api-envi-dev.lambdatestinternal.com/liis",
3231
BUILD_BASE_URL:
33-
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/builds/",
32+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/builds/",
3433
BUILD_STOP_URL:
35-
"https://api-cypress-v2-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
34+
"https://api-envi-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
3635
SESSION_URL:
37-
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
36+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
3837
REPORT_URL:
39-
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
38+
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
4039
},
4140
stage: {
4241
INTEGRATION_BASE_URL: "https://stage-api.lambdatestinternal.com/liis",

commands/utils/set_args.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,15 @@ function sync_args_from_cmd(args) {
416416
lt_config["run_settings"]["dedicated_proxy"] = false;
417417
}
418418

419+
//Allow npm install via tunnel, to install private dependencies which are behind VPN
420+
if ("npm_via_tunnel" in args) {
421+
lt_config["run_settings"]["npm_via_tunnel"] = true
422+
? args["npm_via_tunnel"] == "true"
423+
: false;
424+
} else if (!lt_config["run_settings"]["npm_via_tunnel"]) {
425+
lt_config["run_settings"]["npm_via_tunnel"] = false;
426+
}
427+
419428
//get specs from current directory if specs are not passed in config or cli
420429
if (
421430
(lt_config["run_settings"]["specs"] == undefined ||

commands/utils/validate.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,23 @@ module.exports = validate_config = function (lt_config, validation_configs) {
385385
reject("Error!! Tunnel and Dedicated Proxy can not be passed in same run")
386386
}
387387

388+
//validate if npm_via_tunnel field contains expected value
389+
if ("npm_via_tunnel" in lt_config["run_settings"]) {
390+
if (!(typeof lt_config["run_settings"]["npm_via_tunnel"] === "boolean")) {
391+
reject("Error!! boolean value is expected in npm_via_tunnel key");
392+
}
393+
}
394+
395+
//validate that if npm_via_tunnel is set, tunnel must be set to true
396+
if (lt_config["run_settings"]["npm_via_tunnel"]==true)
397+
{
398+
if (lt_config["tunnel_settings"]["tunnel"] ==false){
399+
reject("Error!! Installing npm packages behind private VPN is supported only with tunnel. Please pass tunnel as true.");
400+
}else{
401+
console.log("Warning!! Using the flag `npm_via_tunnel` may result in higher build duration.");
402+
}
403+
}
404+
388405
if(lt_config)
389406
resolve(cypress_version);
390407
});

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ const argv = require("yargs")
184184
alias: "dedicated_proxy",
185185
describe: "dedicated proxy",
186186
type: "bool",
187+
})
188+
.option("npm_tun", {
189+
alias: "npm_via_tunnel",
190+
describe: "Install npm packages which are behind private VPN. Disclaimer:This will increase the build duration of your tests.",
191+
type: "bool",
187192
});
188193
},
189194
function (argv) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lambdatest-cypress-cli",
3-
"version": "3.0.10",
3+
"version": "3.0.11",
44
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
55
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
66
"author": "LambdaTest <[email protected]>",

0 commit comments

Comments
 (0)