Skip to content

Commit c0c03c0

Browse files
committed
removed logs
1 parent 726a5b0 commit c0c03c0

File tree

7 files changed

+1
-37
lines changed

7 files changed

+1
-37
lines changed

bin/commands/runs.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ module.exports = function run(args, rawArgs) {
5959
return utils.validateBstackJson(bsConfigPath).then(async function (bsConfig) {
6060
markBlockEnd('validateBstackJson');
6161
logger.debug('Completed browserstack.json validation');
62-
63-
console.log("bsConfig after validation",bsConfig);
64-
6562
markBlockStart('setConfig');
6663
logger.debug('Started setting the configs');
6764

@@ -115,8 +112,6 @@ module.exports = function run(args, rawArgs) {
115112
// set build tag caps
116113
utils.setBuildTags(bsConfig, args);
117114

118-
console.log(`checking if testObservability session is enabled line run() 118: ${isTestObservabilitySession}`);
119-
120115
// Send build start to TEST REPORTING AND ANALYTICS
121116
if(isTestObservabilitySession) {
122117
await launchTestSession(bsConfig, bsConfigPath);
@@ -319,7 +314,6 @@ module.exports = function run(args, rawArgs) {
319314
markBlockEnd('createBuild');
320315
markBlockEnd('total');
321316
utils.setProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
322-
console.log(`checking if testObservability session is enabled line 322: ${isTestObservabilitySession}`);
323317
if(isTestObservabilitySession) {
324318
utils.setO11yProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
325319
}
@@ -530,9 +524,7 @@ module.exports = function run(args, rawArgs) {
530524
}).catch(function (err) {
531525
logger.error(err);
532526
utils.setUsageReportingFlag(null, args.disableUsageReporting);
533-
console.log(`now reading using readBsConfigJSON in catch block for validateBstackJson`);
534527
let bsJsonData = utils.readBsConfigJSON(bsConfigPath);
535-
console.log(`checking the type of bsJsonData with main logic: ${typeof bsJsonData}`);
536528
utils.sendUsageReport(bsJsonData, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
537529
process.exitCode = Constants.ERROR_EXIT_CODE;
538530
}).finally(function(){

bin/helpers/helper.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const HttpsProxyAgent = require('https-proxy-agent');
2222
const { TEST_REPORTING_ANALYTICS } = require("../testObservability/helper/constants");
2323

2424
exports.debug = (text, shouldReport = false, throwable = null) => {
25-
console.log(`checking if BROWSERSTACK_OBSERVABILITY_DEBUG is enabled: ${process.env.BROWSERSTACK_OBSERVABILITY_DEBUG}`);
2625
if (process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "true" || process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "1") {
2726
logger.info(`[ ${TEST_REPORTING_ANALYTICS} ] ${text}`);
2827
}
@@ -292,8 +291,6 @@ exports.getBuildDetails = (bsConfig, isO11y = false) => {
292291
projectName = process.env.BROWSERSTACK_PROJECT_NAME || projectName;
293292

294293
/* Pick from testObservabilityOptions */
295-
console.log(`isTestObservabilityOptionsPresent: ${isTestObservabilityOptionsPresent}`);
296-
console.log(`bsConfig in getBuildDetails: ${JSON.stringify(bsConfig, null, 2)}`);
297294
if(isTestObservabilityOptionsPresent) {
298295
buildName = buildName || bsConfig["testObservabilityOptions"]["buildName"];
299296
projectName = projectName || bsConfig["testObservabilityOptions"]["projectName"];

bin/helpers/utils.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ exports.validateBstackJson = (bsConfigPath) => {
3434
logger.info(`Reading config from ${bsConfigPath}`);
3535
let bsConfig = require(bsConfigPath);
3636
bsConfig = exports.normalizeTestReportingConfig(bsConfig);
37-
console.log(`BrowserStack config loaded after normalizing: ${JSON.stringify(bsConfig, null, 2)}`);
3837
resolve(bsConfig);
3938
} catch (e) {
4039
reject(
@@ -494,7 +493,6 @@ exports.setNodeVersion = (bsConfig, args) => {
494493
// specs can be passed via command line args as a string
495494
// command line args takes precedence over config
496495
exports.setUserSpecs = (bsConfig, args) => {
497-
console.log(`checking if testObservability session is enabled setUserSpecs line 497: ${o11yHelpers.isTestObservabilitySession()}`);
498496
if(o11yHelpers.isBrowserstackInfra() && o11yHelpers.isTestObservabilitySession() && o11yHelpers.shouldReRunObservabilityTests()) {
499497
bsConfig.run_settings.specs = process.env.BROWSERSTACK_RERUN_TESTS;
500498
return;
@@ -1238,7 +1236,6 @@ exports.handleSyncExit = (exitCode, dashboard_url) => {
12381236
syncCliLogger.info(Constants.userMessages.BUILD_REPORT_MESSAGE);
12391237
syncCliLogger.info(dashboard_url);
12401238
}
1241-
console.log(`checking if observability session is active from handleSyncExit ${o11yHelpers.isTestObservabilitySession()}`);
12421239
if(o11yHelpers.isTestObservabilitySession()) {
12431240
o11yHelpers.printBuildLink(true, exitCode);
12441241
} else {
@@ -1502,7 +1499,6 @@ exports.splitStringByCharButIgnoreIfWithinARange = (str, splitChar, leftLimiter,
15021499

15031500
// blindly send other passed configs with run_settings and handle at backend
15041501
exports.setOtherConfigs = (bsConfig, args) => {
1505-
console.log(`checking if observability session is active from setOtherConfigs ${o11yHelpers.isTestObservabilitySession()}`);
15061502
if(o11yHelpers.isTestObservabilitySession() && process.env.BS_TESTOPS_JWT) {
15071503
bsConfig["run_settings"]["reporter"] = TEST_OBSERVABILITY_REPORTER;
15081504
return;
@@ -1523,11 +1519,9 @@ exports.readBsConfigJSON = (bsConfigPath) => {
15231519
try {
15241520
fs.accessSync(bsConfigPath, fs.constants.R_OK);
15251521
const configContent = fs.readFileSync(bsConfigPath, 'utf-8');
1526-
console.log(`configContent: ${configContent}`);
15271522
try {
15281523
const bsConfig = JSON.parse(configContent);
15291524
const normalizedBsConfig = exports.normalizeTestReportingConfig(bsConfig);
1530-
console.log(`normalizedBsConfig: ${JSON.stringify(normalizedBsConfig)}`);
15311525
return JSON.stringify(normalizedBsConfig);
15321526
} catch (err) {
15331527
logger.error(`Error parsing JSON from ${bsConfigPath}:`, err);

bin/testObservability/crashReporter/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const httpsKeepAliveAgent = new https.Agent({
1818
});
1919

2020
const debug = (text) => {
21-
console.log(`checking if BROWSERSTACK_OBSERVABILITY_DEBUG is enabled: ${process.env.BROWSERSTACK_OBSERVABILITY_DEBUG}`);
2221
if (process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "true" || process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "1") {
2322
logger.info(`[ ${TEST_REPORTING_ANALYTICS} ] ${text}`);
2423
}

bin/testObservability/helper/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ exports.TEST_OBSERVABILITY_REPORTER_LOCAL = path.join(__dirname, '..', 'reporter
3737

3838
exports.PENDING_QUEUES_FILE = `pending_queues_${process.pid}.json`;
3939

40-
exports.TEST_REPORTING_ANALYTICS = 'TEST REPORTING AND ANALYTICS';
40+
exports.TEST_REPORTING_ANALYTICS = 'TEST REPORTING AND ANALYTICS';

bin/testObservability/helper/helper.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ exports.pending_test_uploads = {
4141
};
4242

4343
exports.debugOnConsole = (text) => {
44-
console.log(`checking if BROWSERSTACK_TEST_OBSERVABILITY_DEBUG is enabled in debugOnConsole: ${process.env.BROWSERSTACK_OBSERVABILITY_DEBUG}`);
4544
if ((process.env.BROWSERSTACK_OBSERVABILITY_DEBUG + '') === "true" ||
4645
(process.env.BROWSERSTACK_OBSERVABILITY_DEBUG + '') === "1") {
4746
consoleHolder.log(`[ ${TEST_REPORTING_ANALYTICS} ] ${text}`);
4847
}
4948
}
5049

5150
exports.debug = (text, shouldReport = false, throwable = null) => {
52-
console.log(`checking if BROWSERSTACK_OBSERVABILITY_DEBUG is enabled in debug 52: ${process.env.BROWSERSTACK_OBSERVABILITY_DEBUG}`);
5351
if (process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "true" || process.env.BROWSERSTACK_OBSERVABILITY_DEBUG === "1") {
5452
logger.info(`[ ${TEST_REPORTING_ANALYTICS} ] ${text}`);
5553
}
@@ -95,7 +93,6 @@ const supportFileCleanup = () => {
9593
exports.buildStopped = false;
9694

9795
exports.printBuildLink = async (shouldStopSession, exitCode = null) => {
98-
console.log(`checking if testObservability session is active from printBuildLink ${this.isTestObservabilitySession()}`);
9996
if(!this.isTestObservabilitySession() || exports.buildStopped) return;
10097
exports.buildStopped = true;
10198
try {
@@ -329,11 +326,8 @@ const getCypressConfigFileContent = (bsConfig, cypressConfigPath) => {
329326
}
330327

331328
exports.setCrashReportingConfigFromReporter = (credentialsStr, bsConfigPath, cypressConfigPath) => {
332-
console.log(`Setting Crash Reporting Config with bsConfigPath: ${bsConfigPath}`);
333-
console.log(`Setting Crash Reporting Config with bsConfig: ${JSON.stringify(bsConfig)}`);
334329
try {
335330
const browserstackConfigFile = utils.readBsConfigJSON(bsConfigPath);
336-
337331
const cypressConfigFile = getCypressConfigFileContent(null, cypressConfigPath);
338332

339333
if(!credentialsStr) {
@@ -350,11 +344,7 @@ exports.setCrashReportingConfigFromReporter = (credentialsStr, bsConfigPath, cyp
350344

351345
const setCrashReportingConfig = (bsConfig, bsConfigPath) => {
352346
try {
353-
console.log(`Setting Crash Reporting Config with bsConfigPath: ${bsConfigPath}`);
354347
const browserstackConfigFile = utils.readBsConfigJSON(bsConfigPath);
355-
console.log(`checking the type of bsConfig: ${typeof bsConfig}`);
356-
console.log(`printing username and acces_key from bsConfig: ${bsConfig["auth"]["username"]} : ${bsConfig["auth"]["access_key"]}`);
357-
358348
const cypressConfigFile = getCypressConfigFileContent(bsConfig, null);
359349
const credentialsStr = JSON.stringify({
360350
username: bsConfig["auth"]["username"],
@@ -532,7 +522,6 @@ exports.batchAndPostEvents = async (eventUrl, kind, data) => {
532522
}
533523

534524
const RequestQueueHandler = require('./requestQueueHandler');
535-
const constants = require('../../helpers/constants');
536525
exports.requestQueueHandler = new RequestQueueHandler();
537526

538527
exports.uploadEventData = async (eventData, run=0) => {
@@ -632,9 +621,6 @@ exports.setTestObservabilityFlags = (bsConfig) => {
632621
/* set default again but under try catch in case of wrong config */
633622
isTestObservabilitySession = utils.nonEmptyArray(bsConfig.run_settings.downloads) ? false : true;
634623

635-
console.log(`bsconfig from setTestObservabilityFlags: ${JSON.stringify(bsConfig)}`);
636-
console.log(`bs test olly enabled from env: ${process.env.BROWSERSTACK_TEST_OBSERVABILITY}`);
637-
638624
if(!utils.isUndefined(bsConfig["testObservability"])) isTestObservabilitySession = ( bsConfig["testObservability"] == true || bsConfig["testObservability"] == 1 );
639625
if(!utils.isUndefined(process.env.BROWSERSTACK_TEST_OBSERVABILITY)) isTestObservabilitySession = ( process.env.BROWSERSTACK_TEST_OBSERVABILITY == "true" || process.env.BROWSERSTACK_TEST_OBSERVABILITY == "1" );
640626
if(process.argv.includes('--disable-test-observability')) isTestObservabilitySession = false;
@@ -660,7 +646,6 @@ exports.setTestObservabilityFlags = (bsConfig) => {
660646
process.env.BROWSERSTACK_TEST_OBSERVABILITY = isTestObservabilitySession;
661647
process.env.BROWSERSTACK_AUTOMATION = isBrowserstackInfra;
662648

663-
console.log(`final testObservability capability is set to in setTestPObservabilityFlag ${isTestObservabilitySession}`);
664649
return [isTestObservabilitySession, isBrowserstackInfra];
665650
}
666651

@@ -867,7 +852,6 @@ exports.resolveModule = (module) => {
867852

868853
const getReRunSpecs = (rawArgs) => {
869854
let finalArgs = rawArgs;
870-
console.log(`checking if testObservability is enabled in getRerun specs ${this.isTestObservabilitySession()}`);
871855
if (this.isTestObservabilitySession() && this.shouldReRunObservabilityTests()) {
872856
let startIdx = -1, numEle = 0;
873857
for(let idx=0; idx<rawArgs.length; idx++) {
@@ -886,7 +870,6 @@ const getReRunSpecs = (rawArgs) => {
886870
}
887871

888872
const getLocalSessionReporter = () => {
889-
console.log(`checking if testObservability is enabled getLocalSessionReporter ${this.isTestObservabilitySession()}`);
890873
if(this.isTestObservabilitySession() && process.env.BS_TESTOPS_JWT) {
891874
return ['--reporter', TEST_OBSERVABILITY_REPORTER_LOCAL];
892875
} else {

bin/testObservability/reporter/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class MyReporter {
8888
})
8989

9090
.on(EVENT_HOOK_BEGIN, async (hook) => {
91-
console.log(`checking testObservability is enabled in hook begin ${this.testObservability}`);
9291
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_BEGIN`);
9392
if(this.testObservability == true) {
9493
if(!hook.hookAnalyticsId) {

0 commit comments

Comments
 (0)