Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 6, 2025

The --detailed-stacktrace command line option was inadvertently broken in v0.50.0 when the verbosity system was unified. The DetailedStacktraceCommandProvider was removed from registration but the TUnitMessageBus still tried to check for the option, causing it to never work.

Root Cause

In TestApplicationBuilderExtensions.cs, the comment indicated that the unified VerbosityCommandProvider "replaces HideTestOutput, DisableLogo, DetailedStacktrace", and the DetailedStacktraceCommandProvider registration was removed. However, the TUnitMessageBus.SimplifyStacktrace() method continued to check for DetailedStacktraceCommandProvider.DetailedStackTrace, which would always return false since the provider was no longer registered.

Solution

This PR restores the --detailed-stacktrace functionality while maintaining the new unified verbosity system:

  1. Re-registered DetailedStacktraceCommandProvider for backward compatibility
  2. Enhanced TUnitMessageBus to check both the legacy --detailed-stacktrace flag and the new VerbosityService.ShowDetailedStackTrace property
  3. Added null-safety to prevent potential NullReferenceException

Behavior After Fix

  • --detailed-stacktrace: Works as before (backward compatible)
  • --verbosity verbose or --verbosity debug: Also enables detailed stack traces (unified approach)
  • --verbosity normal or --verbosity minimal: Standard behavior (no detailed traces)

Both approaches work independently or together, providing full backward compatibility while supporting the modern verbosity system.

Testing

  • Verified PublicAPI tests pass (no breaking changes)
  • Confirmed command line provider registration is correct
  • Validated the logic handles both flag approaches properly

Fixes #2737.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Missing --detailed-stacktrace since v0.50.0 Fix missing --detailed-stacktrace option since v0.50.0 Aug 6, 2025
Copilot AI requested a review from thomhurst August 6, 2025 23:36
Copilot finished work on behalf of thomhurst August 6, 2025 23:36
@thomhurst thomhurst marked this pull request as ready for review August 6, 2025 23:40
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
Copilot AI temporarily deployed to Pull Requests August 6, 2025 23:40 Inactive
@thomhurst thomhurst enabled auto-merge (squash) August 6, 2025 23:40
@thomhurst thomhurst merged commit bac5cb6 into main Aug 7, 2025
12 of 14 checks passed
@thomhurst thomhurst deleted the copilot/fix-2737 branch August 7, 2025 00:05
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.

Missing --detailed-stacktrace since v0.50.0

2 participants