codeceptjs 4.0.2-beta.3 → 4.0.2-beta.4
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.
- package/lib/command/workers/runTests.js +21 -24
- package/package.json +1 -1
|
@@ -116,7 +116,10 @@ initPromise = (async function () {
|
|
|
116
116
|
// We'll reload test files fresh for each test request
|
|
117
117
|
} else {
|
|
118
118
|
// Legacy mode - filter tests upfront
|
|
119
|
+
console.log(`[Worker ${workerIndex}] Starting test filtering. Assigned ${tests.length} test UIDs`)
|
|
119
120
|
filterTests()
|
|
121
|
+
const finalCount = mocha.suite.total()
|
|
122
|
+
console.log(`[Worker ${workerIndex}] After filtering: ${finalCount} tests to run`)
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
// run tests
|
|
@@ -126,6 +129,7 @@ initPromise = (async function () {
|
|
|
126
129
|
await runTests()
|
|
127
130
|
} else {
|
|
128
131
|
// No tests to run, close the worker
|
|
132
|
+
console.error(`[Worker ${workerIndex}] ERROR: No tests found after filtering! Assigned ${tests.length} UIDs but none matched.`)
|
|
129
133
|
parentPort?.close()
|
|
130
134
|
}
|
|
131
135
|
} catch (err) {
|
|
@@ -336,24 +340,24 @@ function filterTests() {
|
|
|
336
340
|
mocha.files = files
|
|
337
341
|
mocha.loadFiles()
|
|
338
342
|
|
|
339
|
-
//
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
allLoadedTests.push({ uid: test.uid, title: test.fullTitle() });
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
console.log(`[Worker ${workerIndex}] Loaded ${allLoadedTests.length} tests, expecting ${tests.length} tests`);
|
|
349
|
-
|
|
350
|
-
const loadedUids = new Set(allLoadedTests.map(t => t.uid));
|
|
351
|
-
const missingTests = tests.filter(uid => !loadedUids.has(uid));
|
|
352
|
-
|
|
353
|
-
if (missingTests.length > 0) {
|
|
354
|
-
console.log(`[Worker ${workerIndex}] WARNING: ${missingTests.length} assigned tests not found in loaded files`);
|
|
355
|
-
console.log(`[Worker ${workerIndex}] Missing UIDs:`, missingTests);
|
|
343
|
+
// Collect all loaded tests for debugging
|
|
344
|
+
const allLoadedTests = [];
|
|
345
|
+
mocha.suite.eachTest(test => {
|
|
346
|
+
if (test) {
|
|
347
|
+
allLoadedTests.push({ uid: test.uid, title: test.fullTitle() });
|
|
356
348
|
}
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
console.log(`[Worker ${workerIndex}] Loaded ${allLoadedTests.length} tests from ${files.length} files`);
|
|
352
|
+
console.log(`[Worker ${workerIndex}] Expecting ${tests.length} test UIDs`);
|
|
353
|
+
|
|
354
|
+
const loadedUids = new Set(allLoadedTests.map(t => t.uid));
|
|
355
|
+
const missingTests = tests.filter(uid => !loadedUids.has(uid));
|
|
356
|
+
|
|
357
|
+
if (missingTests.length > 0) {
|
|
358
|
+
console.error(`[Worker ${workerIndex}] ERROR: ${missingTests.length} assigned tests NOT FOUND in loaded files!`);
|
|
359
|
+
console.error(`[Worker ${workerIndex}] Missing UIDs:`, missingTests);
|
|
360
|
+
console.error(`[Worker ${workerIndex}] Available UIDs:`, Array.from(loadedUids).slice(0, 5), '...');
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
// Recursively filter tests in all suites (including nested ones)
|
|
@@ -367,13 +371,6 @@ function filterTests() {
|
|
|
367
371
|
for (const suite of mocha.suite.suites) {
|
|
368
372
|
filterSuiteTests(suite)
|
|
369
373
|
}
|
|
370
|
-
|
|
371
|
-
// Verify final test count
|
|
372
|
-
if (options.debug || options.verbose) {
|
|
373
|
-
let finalCount = 0;
|
|
374
|
-
mocha.suite.eachTest(() => finalCount++);
|
|
375
|
-
console.log(`[Worker ${workerIndex}] After filtering: ${finalCount} tests will run`);
|
|
376
|
-
}
|
|
377
374
|
}
|
|
378
375
|
|
|
379
376
|
function initializeListeners() {
|