playwright-slack-report-burak 2.0.5 → 2.0.7
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.
|
@@ -14,8 +14,8 @@ const { exec } = require('child_process');
|
|
|
14
14
|
class ResultsParser {
|
|
15
15
|
result;
|
|
16
16
|
separateFlakyTests;
|
|
17
|
-
totalShardCount = process.env.CIRCLE_NODE_TOTAL
|
|
18
|
-
shardIndex = process.env.CIRCLE_NODE_INDEX
|
|
17
|
+
totalShardCount = process.env.CIRCLE_NODE_TOTAL ? parseInt(process.env.CIRCLE_NODE_TOTAL, 10) : 1;
|
|
18
|
+
shardIndex = process.env.CIRCLE_NODE_INDEX ? parseInt(process.env.CIRCLE_NODE_INDEX, 10) : 0;
|
|
19
19
|
constructor(options = { separateFlakyTests: false }) {
|
|
20
20
|
this.result = [];
|
|
21
21
|
this.separateFlakyTests = options.separateFlakyTests;
|
|
@@ -92,10 +92,17 @@ class ResultsParser {
|
|
|
92
92
|
// Write the updated summary back to the file for the current node
|
|
93
93
|
fs.writeFileSync(nodeSummaryFile, JSON.stringify(nodeSummary, null, 2));
|
|
94
94
|
|
|
95
|
-
console.log('current shard index', this.shardIndex, 'type:', typeof this.shardIndex, 'total shard count', this.totalShardCount, 'type:', typeof this.totalShardCount);
|
|
95
|
+
console.log('current shard index', this.shardIndex, 'type:', typeof this.shardIndex, 'total shard count', this.totalShardCount, 'type:', typeof this.totalShardCount, 'CI', process.env.CI, 'type:', typeof process.env.CI);
|
|
96
96
|
if (this.shardIndex === 0 && this.totalShardCount > 1) {
|
|
97
|
+
if (process.env.CI) {
|
|
97
98
|
console.log('Fetching all artifacts...');
|
|
98
99
|
await this.fetchAllArtifacts();
|
|
100
|
+
} else {
|
|
101
|
+
while (!this.allNodeSummaryFilesExist() || !this.allBlobZipsExist()) {
|
|
102
|
+
console.log('Waiting for all blob zips to exist...');
|
|
103
|
+
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for 1 second
|
|
104
|
+
}
|
|
105
|
+
}
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
if (this.allNodeSummaryFilesExist() && this.allBlobZipsExist()) {
|
|
@@ -118,7 +125,7 @@ class ResultsParser {
|
|
|
118
125
|
this.mergeReports();
|
|
119
126
|
return summary;
|
|
120
127
|
} else {
|
|
121
|
-
return { stopReporter: true };
|
|
128
|
+
return { stopReporter: true, currentShardIndex: this.shardIndex, totalShardCount: this.totalShardCount };
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
async getFailures() {
|
|
@@ -70,9 +70,9 @@ class SlackReporter {
|
|
|
70
70
|
this.log(message);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const stopReporter = await this.resultsParser.getParsedResults();
|
|
73
|
+
const { stopReporter, currentShardIndex, totalShardCount } = await this.resultsParser.getParsedResults();
|
|
74
74
|
if (stopReporter) {
|
|
75
|
-
this.log(
|
|
75
|
+
this.log(`❌ Stopping reporter for non-zero index node ${currentShardIndex} of ${totalShardCount}`);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const resultSummary = await this.resultsParser.getParsedResults();
|
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.7",
|
|
34
34
|
"main": "index.js",
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",
|