@arghajit/dummy 0.1.0-beta-16 → 0.1.0-beta-17
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.
|
@@ -247,14 +247,24 @@ class PlaywrightPulseReporter {
|
|
|
247
247
|
const uniqueTestId = test.id;
|
|
248
248
|
// --- REFINED THIS SECTION for testData ---
|
|
249
249
|
const maxWorkers = this.config.workers;
|
|
250
|
-
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
let mappedWorkerId;
|
|
251
|
+
// First, check for the special case where a test is not assigned a worker (e.g., global setup failure).
|
|
252
|
+
if (result.workerIndex === -1) {
|
|
253
|
+
mappedWorkerId = -1; // Keep it as -1 to clearly identify this special case.
|
|
254
|
+
}
|
|
255
|
+
else if (maxWorkers && maxWorkers > 0) {
|
|
256
|
+
// If there's a valid worker, map it to the concurrency slot...
|
|
257
|
+
const zeroBasedId = result.workerIndex % maxWorkers;
|
|
258
|
+
// ...and then shift it to be 1-based (1 to n).
|
|
259
|
+
mappedWorkerId = zeroBasedId + 1;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
// Fallback for when maxWorkers is not defined: just use the original index (and shift to 1-based).
|
|
263
|
+
mappedWorkerId = result.workerIndex + 1;
|
|
264
|
+
}
|
|
256
265
|
const testSpecificData = {
|
|
257
266
|
workerId: mappedWorkerId,
|
|
267
|
+
uniqueWorkerIndex: result.workerIndex, // We'll keep the original for diagnostics
|
|
258
268
|
totalWorkers: maxWorkers,
|
|
259
269
|
configFile: this.config.configFile,
|
|
260
270
|
metadata: this.config.metadata
|
package/package.json
CHANGED