Skip to content

Commit 0c80fd2

Browse files
author
Karan Nagpal
committed
Handle messaging changes
1 parent 56b3e23 commit 0c80fd2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

bin/helpers/capabilityHelper.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ const caps = (bsConfig, zip) => {
7373

7474
// binary was spawned locally
7575
if(obj.local === true) {
76-
if (!Utils.isUndefined(process.env.BSTACK_CYPRESS_RUN_LOCAL_BINARY) && process.env.BSTACK_CYPRESS_RUN_LOCAL_BINARY == "true") {
76+
if (!Utils.isUndefined(process.env.BSTACK_CYPRESS_LOCAL_BINARY_RUNNING) && process.env.BSTACK_CYPRESS_LOCAL_BINARY_RUNNING == "true") {
7777
obj.localMode = null;
7878

7979
// Local Mode
80-
if (obj.local === true && bsConfig.connection_settings.local_mode) {
80+
if (bsConfig.connection_settings.local_mode) {
8181
obj.localMode = bsConfig.connection_settings.local_mode;
8282
if (bsConfig.connection_settings.user_defined_local_mode_warning) {
8383
logger.warn(Constants.userMessages.INVALID_LOCAL_MODE_WARNING);
@@ -87,15 +87,17 @@ const caps = (bsConfig, zip) => {
8787

8888
// Local Identifier
8989
obj.localIdentifier = null;
90-
if (obj.local === true && (bsConfig.connection_settings.localIdentifier || bsConfig.connection_settings.local_identifier)) {
90+
if (bsConfig.connection_settings.localIdentifier || bsConfig.connection_settings.local_identifier) {
9191
obj.localIdentifier = bsConfig.connection_settings.localIdentifier || bsConfig.connection_settings.local_identifier;
9292
logger.info(`Local testing identifier: ${obj.localIdentifier}`);
9393
}
94-
} else {
95-
logger.info(Constants.userMessages.LOCAL_BINARY_ALREADY_RUNNING);
9694
}
9795
}
9896

97+
if (!Utils.isUndefined(process.env.BSTACK_CYPRESS_LOCAL_BINARY_ALREADY_RUNNING) && process.env.BSTACK_CYPRESS_LOCAL_BINARY_ALREADY_RUNNING == "true") {
98+
logger.info(Constants.userMessages.LOCAL_BINARY_ALREADY_RUNNING);
99+
}
100+
99101
logger.info(`Local is set to: ${obj.local} (${obj.local ? Constants.userMessages.LOCAL_TRUE : Constants.userMessages.LOCAL_FALSE})`);
100102

101103
// Project name

bin/helpers/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,8 @@ exports.setupLocalTesting = (bsConfig, args, rawArgs) => {
641641
}
642642
} else {
643643
localIdentifierRunning = true;
644-
process.env.BSTACK_CYPRESS_RUN_LOCAL_BINARY = "true";
644+
process.env.BSTACK_CYPRESS_LOCAL_BINARY_ALREADY_RUNNING = "true"; // shows message when binary is not spawned by the CLI process
645+
process.env.BSTACK_CYPRESS_LOCAL_BINARY_RUNNING = "true";
645646
}
646647
if (!localIdentifierRunning){
647648
bsConfig.connection_settings.usedAutoLocal = true;
@@ -651,6 +652,7 @@ exports.setupLocalTesting = (bsConfig, args, rawArgs) => {
651652
logger.info('Setting up Local testing...');
652653
bs_local.start(bs_local_args, function (localStartError) {
653654
if (that.isUndefined(localStartError)) {
655+
process.env.BSTACK_CYPRESS_LOCAL_BINARY_RUNNING = "true";
654656
resolve(bs_local);
655657
} else {
656658
let message = `name: ${localStartError.name}, message: ${localStartError.message}, extra: ${localStartError.extra}`,

0 commit comments

Comments
 (0)