Skip to content

Commit 6e2cffc

Browse files
committed
chore: logs
1 parent 80b4c6e commit 6e2cffc

File tree

4 files changed

+3
-19
lines changed

4 files changed

+3
-19
lines changed

bin/testObservability/cypress/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let eventsQueue = [];
88
let testRunStarted = false;
99

1010
const browserStackLog = (message) => {
11+
1112
if (!Cypress.env('BROWSERSTACK_LOGS')) return;
1213
cy.task('browserstack_log', message);
1314
}
@@ -55,8 +56,6 @@ Cypress.on('command:start', (command) => {
5556
},
5657
options: { log: false }
5758
});
58-
browserStackLog(`Command started: with args: ${util.format(Cypress.mocha?.getRunner()?.suite?.ctx?.currentTest?.title)}}`);
59-
// browserStackLog(`Command started: ${util.format(command.attributes)} with args: ${util.format(Cypress.mocha)}}`);
6059
/* Send platform details */
6160
eventsQueue.push({
6261
task: 'test_observability_platform_details',

bin/testObservability/helper/helper.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ exports.getHooksForTest = (test) => {
468468
['_beforeAll','_afterAll','_beforeEach','_afterEach'].forEach(hookType => {
469469
let hooks = test.parent[hookType] || []
470470
hooks.forEach(testHook => {
471-
this.debugOnConsole(`[getHooksForTest] Hook ${util.format(testHook)} with title ${testHook.title} and analyticsId ${testHook.hookAnalyticsId}`);
472471
if(testHook.hookAnalyticsId) hooksArr.push(testHook.hookAnalyticsId);
473472
})
474473
});
@@ -480,7 +479,6 @@ exports.mapTestHooks = (test) => {
480479
['_beforeAll','_afterAll','_beforeEach','_afterEach'].forEach(hookType => {
481480
let hooks = test.parent[hookType] || []
482481
hooks.forEach(testHook => {
483-
this.debugOnConsole(`[mapTestHooks] Hook ${util.format(testHook)} with title ${testHook.title} and analyticsId ${testHook.hookAnalyticsId}`);
484482
if(!testHook.hookAnalyticsId) {
485483
testHook.hookAnalyticsId = uuidv4();
486484
} else if(testHook.markedStatus && hookType == '_afterEach') {
@@ -525,10 +523,6 @@ exports.batchAndPostEvents = async (eventUrl, kind, data) => {
525523
}
526524

527525
exports.uploadEventData = async (eventData, run=0) => {
528-
529-
530-
this.debugOnConsole('event data is ' + util.format(eventData))
531-
532526
const requestQueueHandler = require('./requestQueueHandler');
533527
exports.debugOnConsole(`[uploadEventData] ${eventData.event_type}`);
534528
const log_tag = {
@@ -930,7 +924,7 @@ exports.runCypressTestsLocally = (bsConfig, args, rawArgs) => {
930924
logger.info(`Running npx cypress run ${getReRunSpecs(rawArgs.slice(1)).join(' ')} ${getLocalSessionReporter().join(' ')}`);
931925
const cypressProcess = spawn(
932926
'npx',
933-
['cypress', 'run', '--headed', ...getReRunSpecs(rawArgs.slice(1)), ...getLocalSessionReporter()],
927+
['cypress', 'run', ...getReRunSpecs(rawArgs.slice(1)), ...getLocalSessionReporter()],
934928
{ stdio: 'inherit', cwd: process.cwd(), env: process.env, shell: true }
935929
);
936930
cypressProcess.on('close', async (code) => {

bin/testObservability/plugin/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@ const browserstackTestObservabilityPlugin = (on, config, callbacks) => {
77

88
on('task', {
99
test_observability_log(log) {
10-
console.log('test_observability_log', log);
1110
ipc.of.browserstackTestObservability.emit(IPC_EVENTS.LOG, log);
1211
return null;
1312
},
1413
test_observability_command(commandObj) {
15-
console.log('test_observability_command', commandObj);
1614
ipc.of.browserstackTestObservability.emit(IPC_EVENTS.COMMAND, commandObj);
1715
return null;
1816
},
1917
test_observability_platform_details(platformObj) {
20-
console.log('test_observability_platform_details', platformObj);
2118
ipc.of.browserstackTestObservability.emit(IPC_EVENTS.PLATFORM_DETAILS, platformObj);
2219
return null;
2320
},
2421
test_observability_step(log) {
25-
console.log('test_observability_step', log);
2622
ipc.of.browserstackTestObservability.emit(IPC_EVENTS.CUCUMBER, log);
2723
return null;
2824
}

bin/testObservability/reporter/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ class MyReporter {
255255
}
256256
}
257257

258-
uploadTestSteps = async (shouldClearCurrentSteps = true, cypressSteps = null) => {
259-
console.log('uploading test steps');
258+
uploadTestSteps = async (shouldClearCurrentSteps = true, cypressSteps = null) => {
260259
const currentTestSteps = cypressSteps ? cypressSteps : JSON.parse(JSON.stringify(this.currentTestSteps));
261260
/* TODO - Send as test logs */
262261
const allStepsAsLogs = [];
@@ -352,8 +351,6 @@ class MyReporter {
352351
}
353352

354353
const { os, os_version } = await getOSDetailsFromSystem(process.env.observability_product);
355-
debugOnConsole(`${process.env.observability_integration} is integration env`);
356-
debugOnConsole(`platformdetails map is ${util.format(this.platformDetailsMap)} ${process.pid}`);
357354
if(process.env.observability_integration) {
358355
testData = {...testData, integrations: {
359356
[process.env.observability_integration || 'local_grid' ]: {
@@ -368,7 +365,6 @@ class MyReporter {
368365
}
369366
}};
370367
} else if(this.platformDetailsMap[process.pid] && this.platformDetailsMap[process.pid][test.title]) {
371-
debugOnConsole(`Platform details found for test title: ${test.title}`);
372368
const {browser, platform} = this.platformDetailsMap[process.pid][test.title];
373369
testData = {...testData, integrations: {
374370
'local_grid': {
@@ -585,7 +581,6 @@ class MyReporter {
585581
}
586582

587583
cypressPlatformDetailsListener = async({testTitle, browser, platform, cypressVersion}) => {
588-
debugOnConsole(`[MOCHA EVENT] cypressPlatformDetailsListener for testTitle: ${testTitle} ${process.env.observability_integration} ${process.pid}`);
589584
if(!process.env.observability_integration) {
590585
this.platformDetailsMap[process.pid] = this.platformDetailsMap[process.pid] || {};
591586
if(testTitle) this.platformDetailsMap[process.pid][testTitle] = { browser, platform };

0 commit comments

Comments
 (0)