Skip to content

Commit

Permalink
Merge pull request #233 from asad9711/CYP-626
Browse files Browse the repository at this point in the history
CYP-626
  • Loading branch information
asad9711 authored Mar 10, 2023
2 parents 3743a88 + 1b88b9e commit 9f61ff6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
11 changes: 5 additions & 6 deletions commands/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ module.exports = {
"https://api.lambdatest.com/automation/api/v1/cypress/artefacts/test/",
},
beta: {
INTEGRATION_BASE_URL:
"https://api-cypress-v2-dev.lambdatestinternal.com/liis",
INTEGRATION_BASE_URL: "https://api-envi-dev.lambdatestinternal.com/liis",
BUILD_BASE_URL:
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/builds/",
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/builds/",
BUILD_STOP_URL:
"https://api-cypress-v2-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
"https://api-envi-dev.lambdatestinternal.com/api/v1/test/stop?sessionId=",
SESSION_URL:
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/sessions?limit=200&session_id=",
REPORT_URL:
"https://api-cypress-v2-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
"https://api-envi-dev.lambdatestinternal.com/automation/api/v1/cypress/artefacts/test/",
},
stage: {
INTEGRATION_BASE_URL: "https://stage-api.lambdatestinternal.com/liis",
Expand Down
9 changes: 9 additions & 0 deletions commands/utils/set_args.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,15 @@ function sync_args_from_cmd(args) {
lt_config["run_settings"]["dedicated_proxy"] = false;
}

//Allow npm install via tunnel, to install private dependencies which are behind VPN
if ("npm_via_tunnel" in args) {
lt_config["run_settings"]["npm_via_tunnel"] = true
? args["npm_via_tunnel"] == "true"
: false;
} else if (!lt_config["run_settings"]["npm_via_tunnel"]) {
lt_config["run_settings"]["npm_via_tunnel"] = false;
}

//get specs from current directory if specs are not passed in config or cli
if (
(lt_config["run_settings"]["specs"] == undefined ||
Expand Down
17 changes: 17 additions & 0 deletions commands/utils/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,23 @@ module.exports = validate_config = function (lt_config, validation_configs) {
reject("Error!! Tunnel and Dedicated Proxy can not be passed in same run")
}

//validate if npm_via_tunnel field contains expected value
if ("npm_via_tunnel" in lt_config["run_settings"]) {
if (!(typeof lt_config["run_settings"]["npm_via_tunnel"] === "boolean")) {
reject("Error!! boolean value is expected in npm_via_tunnel key");
}
}

//validate that if npm_via_tunnel is set, tunnel must be set to true
if (lt_config["run_settings"]["npm_via_tunnel"]==true)
{
if (lt_config["tunnel_settings"]["tunnel"] ==false){
reject("Error!! Installing npm packages behind private VPN is supported only with tunnel. Please pass tunnel as true.");
}else{
console.log("Warning!! Using the flag `npm_via_tunnel` may result in higher build duration.");
}
}

if(lt_config)
resolve(cypress_version);
});
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ const argv = require("yargs")
alias: "dedicated_proxy",
describe: "dedicated proxy",
type: "bool",
})
.option("npm_tun", {
alias: "npm_via_tunnel",
describe: "Install npm packages which are behind private VPN. Disclaimer:This will increase the build duration of your tests.",
type: "bool",
});
},
function (argv) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambdatest-cypress-cli",
"version": "3.0.10",
"version": "3.0.11",
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
"author": "LambdaTest <[email protected]>",
Expand Down

0 comments on commit 9f61ff6

Please sign in to comment.