Skip to content

Commit

Permalink
Merge pull request #641 from browserstack/OBS_1750_change_defaults
Browse files Browse the repository at this point in the history
Change defaults w.r.t build artifacts
  • Loading branch information
Archish Thakkar committed Jul 14, 2023
2 parents 221ccc2 + a870f83 commit 6d4f141
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/testObservability/helper/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,9 @@ exports.setTestObservabilityFlags = (bsConfig) => {
/* testObservability */
let isTestObservabilitySession = false;
try {
/* set default again but under try catch in case of wrong config */
isTestObservabilitySession = utils.nonEmptyArray(bsConfig.run_settings.downloads) ? false : true;

if(!utils.isUndefined(bsConfig["testObservability"])) isTestObservabilitySession = ( bsConfig["testObservability"] == true || bsConfig["testObservability"] == 1 );
if(!utils.isUndefined(process.env.BROWSERSTACK_TEST_OBSERVABILITY)) isTestObservabilitySession = ( process.env.BROWSERSTACK_TEST_OBSERVABILITY == "true" || process.env.BROWSERSTACK_TEST_OBSERVABILITY == "1" );
if(process.argv.includes('--disable-test-observability')) isTestObservabilitySession = false;
Expand All @@ -750,7 +753,6 @@ exports.setTestObservabilityFlags = (bsConfig) => {
exports.debug(`EXCEPTION while parsing testObservability capability with error ${e}`, true, e);
}


/* browserstackAutomation */
let isBrowserstackInfra = true;
try {
Expand All @@ -762,6 +764,7 @@ exports.setTestObservabilityFlags = (bsConfig) => {
exports.debug(`EXCEPTION while parsing browserstackAutomation capability with error ${e}`, true, e);
}

if(isTestObservabilitySession) logger.warn("testObservability is set to true. Other test reporters you are using will be automatically disabled. Learn more at browserstack.com/docs/test-observability/overview/what-is-test-observability");

process.env.BROWSERSTACK_TEST_OBSERVABILITY = isTestObservabilitySession;
process.env.BROWSERSTACK_AUTOMATION = isBrowserstackInfra;
Expand Down

0 comments on commit 6d4f141

Please sign in to comment.