playwright-slack-report-burak 3.0.22 → 3.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,24 +8,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.generateAllRunSuites =
|
|
9
9
|
void 0;
|
|
10
10
|
|
|
11
|
-
// Helper function to get build URL and CI platform name
|
|
12
|
-
const getBuildInfo = () => {
|
|
13
|
-
if (process.env.GITHUB_ACTIONS || process.env.SAFETYWINGTEST_GITHUB_TOKEN) {
|
|
14
|
-
const repo = process.env.GITHUB_REPOSITORY;
|
|
15
|
-
const runId = process.env.GITHUB_RUN_ID;
|
|
16
|
-
const serverUrl = process.env.GITHUB_SERVER_URL || 'https://github.com';
|
|
17
|
-
const buildUrl = `${serverUrl}/${repo}/actions/runs/${runId}`;
|
|
18
|
-
return {
|
|
19
|
-
url: buildUrl,
|
|
20
|
-
platform: 'GitHub Actions'
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
url: '#',
|
|
25
|
-
platform: 'CI'
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
11
|
const generateAllRunSuites = async (summaryResults) => {
|
|
30
12
|
const suitesResults = [];
|
|
31
13
|
const allSuites = [];
|
|
@@ -273,13 +255,12 @@ const generateProblemCaseList = async (summaryResults) => {
|
|
|
273
255
|
let text = `${title}${list.map((value, index) => `*${index + 1}.* ${value}`).join('\n')}`;
|
|
274
256
|
if (text.length > 2700) {
|
|
275
257
|
text = text.substring(0, 2700) + '...';
|
|
276
|
-
const buildInfo = getBuildInfo();
|
|
277
258
|
array.push({
|
|
278
259
|
type: 'section',
|
|
279
260
|
text: {
|
|
280
261
|
type: 'mrkdwn',
|
|
281
|
-
text: text + '\n\n\n' +
|
|
282
|
-
|
|
262
|
+
text: text + '\n\n\n' + '⚠️ *There are too many items to display here. ' +
|
|
263
|
+
'You can view more on Github Actions* ⚠️',
|
|
283
264
|
},
|
|
284
265
|
},
|
|
285
266
|
{
|
|
@@ -290,7 +271,7 @@ const generateProblemCaseList = async (summaryResults) => {
|
|
|
290
271
|
type: 'plain_text',
|
|
291
272
|
text: 'Go to Build Details'
|
|
292
273
|
},
|
|
293
|
-
url:
|
|
274
|
+
url: 'https://github.com/safetywing/test-automation/actions'
|
|
294
275
|
}]
|
|
295
276
|
});
|
|
296
277
|
} else {
|
|
@@ -375,13 +356,12 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
375
356
|
},
|
|
376
357
|
});
|
|
377
358
|
if (i === summaryResults.failures.length-1) {
|
|
378
|
-
const buildInfo = getBuildInfo();
|
|
379
359
|
failsList.push({
|
|
380
360
|
type: 'section',
|
|
381
361
|
text: {
|
|
382
362
|
type: 'mrkdwn',
|
|
383
363
|
text: '⚠️ *There are too many failures to display in full detail. '+
|
|
384
|
-
|
|
364
|
+
'You can view more on Github Actions* ⚠️',
|
|
385
365
|
},
|
|
386
366
|
},
|
|
387
367
|
{
|
|
@@ -393,7 +373,7 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
393
373
|
type: 'plain_text',
|
|
394
374
|
text: 'Go to Build Details'
|
|
395
375
|
},
|
|
396
|
-
url:
|
|
376
|
+
url: 'https://github.com/safetywing/test-automation/actions'
|
|
397
377
|
}
|
|
398
378
|
]
|
|
399
379
|
});
|
|
@@ -411,13 +391,12 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
411
391
|
},
|
|
412
392
|
});
|
|
413
393
|
if (i > 23) {
|
|
414
|
-
const buildInfo = getBuildInfo();
|
|
415
394
|
failsList.push({
|
|
416
395
|
type: 'section',
|
|
417
396
|
text: {
|
|
418
397
|
type: 'mrkdwn',
|
|
419
398
|
text: '⚠️ *There are too many failures to display here '+
|
|
420
|
-
|
|
399
|
+
'You can view more on Github Actions* ⚠️',
|
|
421
400
|
},
|
|
422
401
|
},
|
|
423
402
|
{
|
|
@@ -428,7 +407,7 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
428
407
|
type: 'plain_text',
|
|
429
408
|
text: 'Go to Build Details'
|
|
430
409
|
},
|
|
431
|
-
url:
|
|
410
|
+
url: 'https://github.com/safetywing/test-automation/actions'
|
|
432
411
|
}]
|
|
433
412
|
});
|
|
434
413
|
break;
|
|
@@ -123,12 +123,17 @@ class SlackReporter {
|
|
|
123
123
|
// This ensures ResultsParser always has correct values, even if we block posting
|
|
124
124
|
this.resultsParser.updateShardInfo(shardIndexNum, totalShards);
|
|
125
125
|
|
|
126
|
+
// CRITICAL: ALL shards must create their node_summary files, even if they don't post to Slack
|
|
127
|
+
// This must happen BEFORE the early return for non-shard-1 shards
|
|
128
|
+
const resultSummary = await this.resultsParser.getParsedResults();
|
|
129
|
+
|
|
126
130
|
// Only allow shard 1 to post when there are multiple shards
|
|
127
131
|
// This ensures only one shard posts the aggregated report
|
|
128
132
|
if (totalShards > 1 && shardIndexNum !== 1) {
|
|
129
133
|
this.log(`❌ [Shard Detection] BLOCKING: Non-shard-1 detected (shard ${shardIndexNum} of ${totalShards})`);
|
|
130
134
|
this.log(`❌ Stopping reporter for shard ${shardIndexNum} of ${totalShards}`);
|
|
131
135
|
this.log(`ℹ️ Only shard 1 will post the aggregated report.`);
|
|
136
|
+
this.log(`✅ Node summary file created for shard ${shardIndexNum}`);
|
|
132
137
|
return;
|
|
133
138
|
}
|
|
134
139
|
|
|
@@ -138,8 +143,6 @@ class SlackReporter {
|
|
|
138
143
|
} else {
|
|
139
144
|
this.log(`✅ [Shard Detection] ALLOWING: Multiple shards detected (${totalShards}). Shard ${shardIndexNum} will post aggregated report.`);
|
|
140
145
|
}
|
|
141
|
-
|
|
142
|
-
const resultSummary = await this.resultsParser.getParsedResults();
|
|
143
146
|
resultSummary.meta = this.meta;
|
|
144
147
|
const maxRetry = Math.max(...resultSummary.tests.map((o) => o.retry));
|
|
145
148
|
if (this.sendResults === 'on-failure'
|
package/package.json
CHANGED