Skip to content

Mark debugger tests as ConditionalFact to skip on NativeAOT#121152

Merged
MichalStrehovsky merged 2 commits intomainfrom
copilot/convert-tests-to-conditional-fact
Oct 29, 2025
Merged

Mark debugger tests as ConditionalFact to skip on NativeAOT#121152
MichalStrehovsky merged 2 commits intomainfrom
copilot/convert-tests-to-conditional-fact

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

Five debugger-related tests added in #121054 fail in NativeAOT outerloop runs where DebuggerDisplay/DebuggerTypeProxy attributes are unsupported.

Changes

Converted five test methods in ActivityTests.cs from [Fact] to [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]:

  • TestActivityDebuggerDisplay
  • TestActivityDebuggerProxy
  • TestActivityContextDebuggerDisplay
  • TestActivityLinkDebuggerDisplay
  • TestActivityEventDebuggerDisplay

This matches the pattern used for similar debugger tests throughout the codebase (System.Linq, System.Collections.Concurrent, System.Collections.Immutable, etc.) and ensures tests are skipped on platforms where PlatformDetection.IsDebuggerTypeProxyAttributeSupported returns false.

Original prompt

Convert the tests added in #121054 from [Fact] to [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))], matching the pattern used for similar tests across the repo. This will avoid failures in NativeAOT outerloop runs, where DebuggerDisplay/DebuggerTypeProxy support is not available. The affected tests are: TestActivityDebuggerDisplay, TestActivityDebuggerProxy, TestActivityContextDebuggerDisplay, TestActivityLinkDebuggerDisplay, and TestActivityEventDebuggerDisplay in src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs.

This pull request was created as a result of the following prompt from Copilot chat.

Convert the tests added in #121054 from [Fact] to [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))], matching the pattern used for similar tests across the repo. This will avoid failures in NativeAOT outerloop runs, where DebuggerDisplay/DebuggerTypeProxy support is not available. The affected tests are: TestActivityDebuggerDisplay, TestActivityDebuggerProxy, TestActivityContextDebuggerDisplay, TestActivityLinkDebuggerDisplay, and TestActivityEventDebuggerDisplay in src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs.


💡 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.

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert tests to use ConditionalFact for platform compatibility Mark debugger tests as ConditionalFact to skip on NativeAOT Oct 29, 2025
@MichalStrehovsky
Copy link
Member

/ba-g infrastructure timeout

@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review October 29, 2025 06:01
Copilot AI review requested due to automatic review settings October 29, 2025 06:01
@MichalStrehovsky MichalStrehovsky merged commit 7201a39 into main Oct 29, 2025
88 of 92 checks passed
@MichalStrehovsky MichalStrehovsky deleted the copilot/convert-tests-to-conditional-fact branch October 29, 2025 06:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates debugger-related tests in ActivityTests.cs to use conditional execution based on platform support for debugger type proxy attributes. These tests were previously marked with [Fact] and are now marked with [ConditionalFact] to ensure they only run on platforms where debugger attributes are supported (i.e., not on NativeAOT).

Key Changes

  • Converted five test methods from [Fact] to [ConditionalFact] with platform detection
  • All changes target tests that validate debugger display and debugger proxy functionality
  • Pattern is consistent with similar debugger tests across other libraries in the codebase

@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants