Skip to content

Commit aa7850a

Browse files
committed
allowing custom env vars support
1 parent d9da2e4 commit aa7850a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

commands/utils/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module.exports = {
1212
LAMBDA_CONFIG: "./lambdatest-config.json",
1313
SUPPORTED_CYPRESS_VERSIONS: ["5", "6"],
1414
WHITELISTED_ENV_VARS: ["CI_BUILD_ID", "PERCY_TOKEN", "QASE_REPORT", "QASE_RUN_ID", "QASE_RUN_NAME", "QASE_RUN_DESCRIPTION", "QASE_API_TOKEN", "QASE_API_BASE_URL", "QASE_ENVIRONMENT_ID", "QASE_SCREENSHOT_FOLDER", "QASE_SCREENSHOT_SENDING", "QASE_RUN_COMPLETE"],
15+
BLOCKED_ENV_VARS: ["MANPATH", "NVM_CD_FLAGS", "TERM", "SHELL", "TMPDIR", "SSH_CLIENT", "NVM_PATH", "SSH_TTY", "NVM_DIR",
16+
"USER", "PATH", "NVM_NODEJS_ORG_MIRROR", "PWD", "LANG", "SHLVL", "HOME", "LOGNAME", "SSH_CONNECTION", "LC_CTYPE", "NVM_BIN", "NVM_IOJS_ORG_MIRROR", "OLDPWD"],
1517
BUILD_END_STATES:
1618
"&status=running,queued,created,initiated,pqueued,error,lambda error,failed,completed,queue_timeout,idle_timeout,stopped,cancelled,passed,timeout,inactive",
1719
BUILD_ERROR_STATES: "&status=error,lambda error,failed",

commands/utils/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ module.exports = validate_config = function (lt_config, validation_configs) {
375375
let envValue;
376376
Object.keys(sys_envs).forEach(function (envKey) {
377377
envValue = sys_envs[envKey];
378-
if (envKey && !constants.WHITELISTED_ENV_VARS.includes(envKey)) {
378+
if (envKey && constants.BLOCKED_ENV_VARS.includes(envKey)) {
379379
reject(
380-
`Usage of unwanted environment variable detected. Allowed variables are - ${constants.WHITELISTED_ENV_VARS}`
380+
`Usage of unwanted environment variable detected. Blocked variables are - ${constants.BLOCKED_ENV_VARS}`
381381
);
382382
}
383383
if (envValue == undefined || envValue === "") {

0 commit comments

Comments
 (0)