playwright-slack-report-burak 2.0.12 → 2.0.14
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.
|
@@ -93,14 +93,12 @@ class ResultsParser {
|
|
|
93
93
|
fs.writeFileSync(nodeSummaryFile, JSON.stringify(nodeSummary, null, 2));
|
|
94
94
|
|
|
95
95
|
if (this.shardIndex === 0 && this.totalShardCount > 1) {
|
|
96
|
-
/* console.log('Fetching all artifacts...');
|
|
97
|
-
await this.fetchAllArtifacts(); */
|
|
98
96
|
if (process.env.CI) {
|
|
99
97
|
console.log('Fetching all artifacts...');
|
|
100
98
|
await this.fetchAllArtifacts();
|
|
101
99
|
} else {
|
|
102
100
|
while (!this.allNodeSummaryFilesExist() || !this.allBlobZipsExist()) {
|
|
103
|
-
console.log('Waiting for all
|
|
101
|
+
console.log('Waiting for all both to exist...');
|
|
104
102
|
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for 1 second
|
|
105
103
|
}
|
|
106
104
|
}
|
|
@@ -108,7 +106,7 @@ class ResultsParser {
|
|
|
108
106
|
|
|
109
107
|
console.log('Contents of playwright-report for node', this.shardIndex, ':', fs.readdirSync(summariesDir));
|
|
110
108
|
|
|
111
|
-
if (this.allNodeSummaryFilesExist() && this.allBlobZipsExist()) {
|
|
109
|
+
if (this.allNodeSummaryFilesExist() && this.allBlobZipsExist() && this.shardIndex === 0) {
|
|
112
110
|
// Merge all node summaries into the final summary
|
|
113
111
|
for (let i = 0; i < this.totalShardCount; i++) {
|
|
114
112
|
const nodeSummaryFile = path.join(summariesDir, `node_summary_${i}.json`);
|
|
@@ -343,9 +341,10 @@ class ResultsParser {
|
|
|
343
341
|
mergeReports() {
|
|
344
342
|
try {
|
|
345
343
|
// Execute the command to merge reports
|
|
346
|
-
exec('npx playwright merge-reports --reporter html
|
|
344
|
+
exec('npx playwright merge-reports --reporter html playwright-report');
|
|
345
|
+
//new Promise(resolve => setTimeout(resolve, 5000));
|
|
347
346
|
console.log('Reports merged successfully.');
|
|
348
|
-
console.log('Contents of playwright-report
|
|
347
|
+
console.log('Contents of playwright-report:', fs.readdirSync('./playwright-report'));
|
|
349
348
|
} catch (error) {
|
|
350
349
|
// Log a warning instead of throwing an error
|
|
351
350
|
console.warn('Warning: Failed to merge reports. This may not affect the overall process.', error.message);
|
|
@@ -70,12 +70,12 @@ class SlackReporter {
|
|
|
70
70
|
this.log(message);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const resultSummary = await this.resultsParser.getParsedResults();
|
|
74
|
+
// SHARDING SUPPORT - Stop slack messages for non-zero index node
|
|
75
|
+
if (process.env.CIRCLE_NODE_INDEX && process.env.CIRCLE_NODE_INDEX !== '0') {
|
|
76
|
+
this.log(`❌ Stopping reporter for non-zero index node ${process.env.CIRCLE_NODE_INDEX} of ${process.env.CIRCLE_NODE_TOTAL}`);
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const resultSummary = await this.resultsParser.getParsedResults();
|
|
79
79
|
resultSummary.meta = this.meta;
|
|
80
80
|
const maxRetry = Math.max(...resultSummary.tests.map((o) => o.retry));
|
|
81
81
|
if (this.sendResults === 'on-failure'
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lint-fix": "npx eslint . --ext .ts --fix"
|
|
31
31
|
},
|
|
32
32
|
"name": "playwright-slack-report-burak",
|
|
33
|
-
"version": "2.0.
|
|
33
|
+
"version": "2.0.14",
|
|
34
34
|
"main": "index.js",
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",
|