Skip to content

Commit 42d582d

Browse files
committed
Include an environment variable to control whether the failure summary is shown, with the default behavior being enabled
1 parent 416bdf4 commit 42d582d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/Testing/Events/Recorder/Event.ConsoleOutputRecorder.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ extension Event.ConsoleOutputRecorder {
307307
@discardableResult public func record(_ event: borrowing Event, in context: borrowing Event.Context) -> Bool {
308308
let messages = _humanReadableOutputRecorder.record(event, in: context)
309309

310-
// Print failure summary when run ends
311-
if case .runEnded = event.kind {
310+
// Print failure summary when run ends, unless an environment variable is
311+
// set to explicitly disable it.
312+
if case .runEnded = event.kind, Environment.flag(named: "SWT_FAILURE_SUMMARY_ENABLED") != false {
312313
if let summary = _humanReadableOutputRecorder.generateFailureSummary(options: options) {
313314
// Add blank line before summary and after summary for visual separation
314315
write("\n\(summary)\n")

0 commit comments

Comments
 (0)