Skip to content

Conversation

@thomhurst
Copy link
Owner

Summary

  • Fixes [Bug]: 1.9.42 broke test output #4325 - Console.WriteLine output not visible in Rider since v1.9.42
  • Always adds StandardOutputProperty and StandardErrorProperty to test nodes regardless of output mode
  • Removes the unused IsDetailedOutput check that was preventing IDE test output display

Root Cause

PR #4257 fixed duplicate output in "Detailed" mode by skipping StandardOutputProperty when IsDetailedOutput was true. However, IDEs like Rider are detected as "detailed" mode (because their client ID doesn't contain "console") but still need these properties to display test output in their results panel.

The real-time console output duplication is already handled separately by HideTestOutput in OptimizedConsoleInterceptor, so StandardOutputProperty should always be included for IDE consumption.

Test plan

  • Build succeeds
  • ConsoleTests pass and show output in "Standard output" section
  • CaptureOutputTests pass with correct output capture
  • Manual verification in Rider that Console.WriteLine output appears in test results

🤖 Generated with Claude Code

Fixes #4325

PR #4257 incorrectly skipped adding StandardOutputProperty/StandardErrorProperty
to test nodes when in "detailed" output mode. IDEs like Rider are detected as
detailed mode but still need these properties to display test output in their
results panel.

The real-time console output duplication is already handled separately by
HideTestOutput in OptimizedConsoleInterceptor, so StandardOutputProperty
should always be included for IDE consumption.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thomhurst
Copy link
Owner Author

Summary

Fixes Console.WriteLine output not appearing in Rider by always including StandardOutputProperty and StandardErrorProperty in test nodes.

Critical Issues

None found ✅

Analysis

The fix correctly addresses the root cause identified in #4325. Here's why this change is correct:

The Problem:

  • PR fix: Duplicated output in "Detailed" mode #4257 added a check to skip StandardOutputProperty when IsDetailedOutput was true to prevent duplicate console output
  • However, IDEs like Rider are detected as "detailed" mode (via VerbosityService.IsDetailedOutput at line 58 - returns true when client ID doesn't contain "console")
  • IDEs need these properties to display output in their test results panel, even though they're classified as "detailed"

The Solution:

  • Real-time console output duplication is already handled by HideTestOutput in OptimizedConsoleInterceptor.cs:66-70, which checks VerbosityService.HideTestOutput (not IsDetailedOutput)
  • The IsDetailedOutput check in TestExtensions.cs:162 was redundant and breaking IDE output display
  • The fix correctly removes this check and always includes the properties when output exists

Code Quality:

  • Properly removes the now-unused IsDetailedOutput() method and _cachedIsDetailedOutput field
  • Removes the unused using TUnit.Engine.Services; import
  • Test coverage exists via ConsoleTests and CaptureOutputTests mentioned in the test plan

TUnit Rules Compliance:

  • ✅ No source generator changes - no snapshot updates needed
  • ✅ No public API changes
  • ✅ No VSTest usage
  • ✅ No performance regressions (actually removes unnecessary method calls)
  • ✅ No reflection usage

Verdict

APPROVE - Clean fix that correctly addresses the root cause without side effects.

@thomhurst thomhurst merged commit 73715b0 into main Jan 12, 2026
13 checks passed
@thomhurst thomhurst deleted the fix/ide-console-output-4325 branch January 12, 2026 21:19
This was referenced Jan 13, 2026
This was referenced Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 1.9.42 broke test output

2 participants