From 64aa64bf8c401da37de90c915fcf8f3127852ad1 Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Wed, 24 Sep 2025 16:31:49 +0200 Subject: [PATCH 1/2] fix: wrong stats when running with workers --- lib/command/workers/runTests.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/command/workers/runTests.js b/lib/command/workers/runTests.js index f2f8cacd9..c8ff7a495 100644 --- a/lib/command/workers/runTests.js +++ b/lib/command/workers/runTests.js @@ -23,11 +23,36 @@ const Codecept = require(process.env.CODECEPT_CLASS_PATH || '../../codecept') const { options, tests, testRoot, workerIndex, poolMode } = workerData // hide worker output -if (!options.debug && !options.verbose) +// In pool mode, always hide worker output to prevent duplicate output +// In regular mode, hide result output but allow step output in verbose/debug +if (poolMode || (!options.debug && !options.verbose)) { process.stdout.write = string => { stdout += string return true } +} else { + // In verbose/debug mode for test/suite modes, show step details + // but suppress individual worker result summaries to avoid duplicate output + const originalWrite = process.stdout.write + const originalConsoleLog = console.log + + process.stdout.write = string => { + // Suppress individual worker result summaries and failure reports + if (string.includes(' FAIL |') || string.includes(' OK |') || string.includes('-- FAILURES:') || string.includes('AssertionError:') || string.includes('◯ File:') || string.includes('◯ Scenario Steps:')) { + return true + } + return originalWrite.call(process.stdout, string) + } + + // Override console.log to catch result summaries + console.log = (...args) => { + const fullMessage = args.join(' ') + if (fullMessage.includes(' FAIL |') || fullMessage.includes(' OK |') || fullMessage.includes('-- FAILURES:')) { + return + } + return originalConsoleLog.apply(console, args) + } +} const overrideConfigs = tryOrDefault(() => JSON.parse(options.override), {}) From 4b8cae082ef244a07bacd836b12c8b788aac288f Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Wed, 24 Sep 2025 17:09:25 +0200 Subject: [PATCH 2/2] fix: failed runner tests --- lib/command/workers/runTests.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/command/workers/runTests.js b/lib/command/workers/runTests.js index c8ff7a495..7223ec36d 100644 --- a/lib/command/workers/runTests.js +++ b/lib/command/workers/runTests.js @@ -23,9 +23,22 @@ const Codecept = require(process.env.CODECEPT_CLASS_PATH || '../../codecept') const { options, tests, testRoot, workerIndex, poolMode } = workerData // hide worker output -// In pool mode, always hide worker output to prevent duplicate output +// In pool mode, only suppress output if debug is NOT enabled // In regular mode, hide result output but allow step output in verbose/debug -if (poolMode || (!options.debug && !options.verbose)) { +if (poolMode && !options.debug) { + // In pool mode without debug, suppress only result summaries and failures, but allow Scenario Steps + const originalWrite = process.stdout.write + process.stdout.write = string => { + // Always allow Scenario Steps output + if (string.includes('Scenario Steps:')) { + return originalWrite.call(process.stdout, string) + } + if (string.includes(' FAIL |') || string.includes(' OK |') || string.includes('-- FAILURES:') || string.includes('AssertionError:') || string.includes('◯ File:')) { + return true + } + return originalWrite.call(process.stdout, string) + } +} else if (!poolMode && !options.debug && !options.verbose) { process.stdout.write = string => { stdout += string return true