Skip to content

Commit a0b224b

Browse files
committed
chore: comments
1 parent 5e9257c commit a0b224b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bin/testObservability/helper/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ const RequestQueueHandler = require('./requestQueueHandler');
509509
exports.requestQueueHandler = new RequestQueueHandler();
510510

511511
exports.uploadEventData = async (eventData, run=0) => {
512+
exports.debugOnConsole(`[uploadEventData] ${eventData.event_type}`);
512513
const log_tag = {
513514
['TestRunStarted']: 'Test_Start_Upload',
514515
['TestRunFinished']: 'Test_End_Upload',

bin/testObservability/reporter/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ class MyReporter {
8888
})
8989

9090
.on(EVENT_HOOK_BEGIN, async (hook) => {
91+
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_BEGIN`);
9192
if(this.testObservability == true) {
9293
if(!hook.hookAnalyticsId) {
9394
hook.hookAnalyticsId = uuidv4();
9495
} else if(this.runStatusMarkedHash[hook.hookAnalyticsId]) {
9596
delete this.runStatusMarkedHash[hook.hookAnalyticsId];
9697
hook.hookAnalyticsId = uuidv4();
9798
}
99+
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_BEGIN for uuid: ${hook.hookAnalyticsId}`);
98100
hook.hook_started_at = (new Date()).toISOString();
99101
hook.started_at = (new Date()).toISOString();
100102
this.current_hook = hook;
@@ -103,6 +105,7 @@ class MyReporter {
103105
})
104106

105107
.on(EVENT_HOOK_END, async (hook) => {
108+
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_END`);
106109
if(this.testObservability == true) {
107110
if(!this.runStatusMarkedHash[hook.hookAnalyticsId]) {
108111
if(!hook.hookAnalyticsId) {
@@ -115,6 +118,9 @@ class MyReporter {
115118

116119
// Remove hooks added at hook start
117120
delete this.hooksStarted[hook.hookAnalyticsId];
121+
122+
debugOnConsole(`[MOCHA EVENT] EVENT_HOOK_END for uuid: ${hook.hookAnalyticsId}`);
123+
118124
await this.sendTestRunEvent(hook,undefined,false,"HookRunFinished");
119125
}
120126
}
@@ -185,10 +191,12 @@ class MyReporter {
185191

186192
.once(EVENT_RUN_END, async () => {
187193
try {
194+
debugOnConsole(`[MOCHA EVENT] EVENT_RUN_END`);
188195
if(this.testObservability == true) {
189196
const hookSkippedTests = getHookSkippedTests(this.runner.suite);
190197
for(const test of hookSkippedTests) {
191198
if(!test.testAnalyticsId) test.testAnalyticsId = uuidv4();
199+
debugOnConsole(`[MOCHA EVENT] EVENT_RUN_END TestRunSkipped for uuid: ${test.testAnalyticsId}`);
192200
await this.sendTestRunEvent(test,undefined,false,"TestRunSkipped");
193201
}
194202
}
@@ -390,6 +398,7 @@ class MyReporter {
390398
mapTestHooks(test);
391399
}
392400
} catch(e) {
401+
debugOnConsole(`Exception in processing hook data for event ${eventType} with error : ${e}`);
393402
debug(`Exception in processing hook data for event ${eventType} with error : ${e}`, true, e);
394403
}
395404

@@ -486,6 +495,7 @@ class MyReporter {
486495
this.hooksStarted = {};
487496
}
488497
} catch(error) {
498+
debugOnConsole(`Exception in populating test data for event ${eventType} with error : ${error}`);
489499
debug(`Exception in populating test data for event ${eventType} with error : ${error}`, true, error);
490500
}
491501
}

0 commit comments

Comments
 (0)