Skip to content

Commit 0aa56b1

Browse files
Merge pull request #446 from abhishek-lambda/CBT-21260
CBT-21260: Add region capability
2 parents b1eccb0 + 2807b47 commit 0aa56b1

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

commands/utils/set_args.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ function sync_args_from_cmd(args) {
461461
lt_config["run_settings"]["timezone"] = "";
462462
}
463463

464+
//Check for region
465+
if ("region" in args) {
466+
lt_config["run_settings"]["region"] = args["region"];
467+
} else if (!lt_config["run_settings"]["region"]) {
468+
lt_config["run_settings"]["region"] = "";
469+
}
470+
464471
if ("privateCloud" in args) {
465472
if (args["privateCloud"]=="true"){
466473
lt_config["run_settings"]["privateCloud"] = true;

commands/utils/validate.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ module.exports = validate_config = function (lt_config, validation_configs) {
205205
}
206206
}
207207

208+
//validate if region field contains expected value
209+
if ("region" in lt_config["run_settings"]) {
210+
if (
211+
!(
212+
typeof lt_config["run_settings"]["region"] === "string"
213+
)
214+
) {
215+
reject("Error!! string value is expected in region key");
216+
}
217+
}
218+
208219
//validate if accessibility field contains expected value
209220
if ("accessibility" in lt_config["run_settings"]) {
210221
if (![true, false].includes(lt_config["run_settings"]["accessibility"])) {

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ const argv = require("yargs")
261261
describe: "Set custom timezone in machine for cypress.",
262262
type: "string",
263263
})
264+
.option("reg",{
265+
alias: "region",
266+
describe: "Set data center region (e.g., us, eu, ap)",
267+
type: "string",
268+
})
264269
.option("pC",{
265270
alias: "privateCloud",
266271
describe: "Set custom private Cloud",

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.43",
3+
"version": "3.0.44",
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)