Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion lib/command/workers/runTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,49 @@ 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, 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) {
// 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
}
} 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), {})

Expand Down