playwright-slack-report-burak 3.0.17 → 3.0.18
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.
|
@@ -35,10 +35,14 @@ class ResultsParser {
|
|
|
35
35
|
separateFlakyTests;
|
|
36
36
|
// Handle both 0-based and 1-based shard indexing
|
|
37
37
|
// If MATRIX_SHARD is not set, try to infer from workflow (1-based) or default to 0
|
|
38
|
-
totalShardCount = process.env.
|
|
39
|
-
|
|
40
|
-
? parseInt(process.env.
|
|
41
|
-
|
|
38
|
+
totalShardCount = process.env.TOTAL_SHARDS
|
|
39
|
+
? parseInt(process.env.TOTAL_SHARDS, 10)
|
|
40
|
+
: (process.env.MATRIX_COUNT ? parseInt(process.env.MATRIX_COUNT, 10) : 1);
|
|
41
|
+
shardIndex = process.env.SHARD_INDEX !== undefined
|
|
42
|
+
? parseInt(process.env.SHARD_INDEX, 10)
|
|
43
|
+
: (process.env.MATRIX_SHARD !== undefined
|
|
44
|
+
? parseInt(process.env.MATRIX_SHARD, 10)
|
|
45
|
+
: (process.env.MATRIX_INDEX !== undefined ? parseInt(process.env.MATRIX_INDEX, 10) : 0));
|
|
42
46
|
|
|
43
47
|
// Determine if we're using 1-based indexing (workflow-style) or 0-based
|
|
44
48
|
// This is detected by checking if artifacts exist with 1-based naming
|
|
@@ -50,6 +54,8 @@ class ResultsParser {
|
|
|
50
54
|
console.log(`📦 [ResultsParser] playwright-slack-report-burak v${packageVersion}`);
|
|
51
55
|
// Log shard detection in ResultsParser
|
|
52
56
|
console.log('🔍 [ResultsParser] Initialized with shard detection:');
|
|
57
|
+
console.log(`🔍 SHARD_INDEX env: ${process.env.SHARD_INDEX !== undefined ? `"${process.env.SHARD_INDEX}"` : 'undefined'}`);
|
|
58
|
+
console.log(`🔍 TOTAL_SHARDS env: ${process.env.TOTAL_SHARDS !== undefined ? `"${process.env.TOTAL_SHARDS}"` : 'undefined'}`);
|
|
53
59
|
console.log(`🔍 MATRIX_SHARD env: ${process.env.MATRIX_SHARD !== undefined ? `"${process.env.MATRIX_SHARD}"` : 'undefined'}`);
|
|
54
60
|
console.log(`🔍 MATRIX_INDEX env: ${process.env.MATRIX_INDEX !== undefined ? `"${process.env.MATRIX_INDEX}"` : 'undefined'}`);
|
|
55
61
|
console.log(`🔍 MATRIX_COUNT env: ${process.env.MATRIX_COUNT !== undefined ? `"${process.env.MATRIX_COUNT}"` : 'undefined'}`);
|
|
@@ -343,6 +343,8 @@ class SlackReporter {
|
|
|
343
343
|
|
|
344
344
|
// Check for Playwright shard environment variables (Playwright may set these)
|
|
345
345
|
this.log(`🔍 PLAYWRIGHT_SHARD: ${process.env.PLAYWRIGHT_SHARD !== undefined ? `"${process.env.PLAYWRIGHT_SHARD}"` : 'undefined'}`);
|
|
346
|
+
this.log(`🔍 SHARD_INDEX: ${process.env.SHARD_INDEX !== undefined ? `"${process.env.SHARD_INDEX}"` : 'undefined'}`);
|
|
347
|
+
this.log(`🔍 TOTAL_SHARDS: ${process.env.TOTAL_SHARDS !== undefined ? `"${process.env.TOTAL_SHARDS}"` : 'undefined'}`);
|
|
346
348
|
|
|
347
349
|
// Check Playwright's shard config (highest priority for local runs)
|
|
348
350
|
let playwrightShardInfo = null;
|
|
@@ -400,6 +402,9 @@ class SlackReporter {
|
|
|
400
402
|
// Playwright uses 1-based indexing, convert to 0-based
|
|
401
403
|
currentShardIndex = (playwrightShardInfo.current - 1).toString();
|
|
402
404
|
this.log(`🔍 [Shard Detection] Using Playwright shard config (converted to 0-based): "${currentShardIndex}"`);
|
|
405
|
+
} else if (process.env.SHARD_INDEX !== undefined) {
|
|
406
|
+
currentShardIndex = process.env.SHARD_INDEX;
|
|
407
|
+
this.log(`🔍 [Shard Detection] Using SHARD_INDEX env var: "${currentShardIndex}"`);
|
|
403
408
|
} else if (process.env.MATRIX_SHARD !== undefined) {
|
|
404
409
|
currentShardIndex = process.env.MATRIX_SHARD;
|
|
405
410
|
this.log(`🔍 [Shard Detection] Using MATRIX_SHARD env var: "${currentShardIndex}"`);
|
|
@@ -418,6 +423,9 @@ class SlackReporter {
|
|
|
418
423
|
if (playwrightShardInfo) {
|
|
419
424
|
totalShards = playwrightShardInfo.total;
|
|
420
425
|
this.log(`🔍 [Shard Detection] Using Playwright shard config totalShards: ${totalShards}`);
|
|
426
|
+
} else if (process.env.TOTAL_SHARDS !== undefined) {
|
|
427
|
+
totalShards = parseInt(process.env.TOTAL_SHARDS, 10);
|
|
428
|
+
this.log(`🔍 [Shard Detection] Using TOTAL_SHARDS env var: ${totalShards}`);
|
|
421
429
|
} else if (process.env.MATRIX_COUNT !== undefined) {
|
|
422
430
|
totalShards = parseInt(process.env.MATRIX_COUNT, 10);
|
|
423
431
|
this.log(`🔍 [Shard Detection] Using MATRIX_COUNT env var: ${totalShards}`);
|
package/package.json
CHANGED