-
-
Notifications
You must be signed in to change notification settings - Fork 106
Fix VSCode test discovery: Add missing MSBuild properties for editor gutter integration #2858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: thomhurst <[email protected]>
Co-authored-by: thomhurst <[email protected]>
…ties Co-authored-by: thomhurst <[email protected]>
…operties for improved test discovery
|
Claude finished @Copilot's task —— View job PR Review: VSCode Test Discovery FixI've completed a thorough review of this PR. Here's my comprehensive analysis: Todo List:
Code Quality Assessment✅ Strong Points
|
Tests with circular dependencies were causing indefinite hangs when scheduled for execution, as each test would wait for its dependencies that could never complete. This fix adds proactive circular dependency detection in ExecutionPlan.Create: - Uses depth-first search with visit state tracking to detect cycles - Marks all tests in a cycle as Failed with descriptive error message - Completes their TaskCompletionSource to prevent waiting - Excludes circular tests from execution scheduling and topological sort - Reports all pre-failed tests through message bus for proper test result output Tests like ConflictingDependsOnTests that have circular dependencies (Test1 -> Test2 -> Test1) now fail immediately with clear error messages instead of hanging indefinitely. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Claude finished @Copilot's task —— View job PR Review: VSCode Test Discovery FixI've completed a comprehensive review of this PR. Here's my detailed analysis: Review Checklist:
🚨 Critical Issue: Scope CreepThis PR has significantly evolved beyond its stated purpose. The title indicates "VSCode test discovery fixes" but it now includes a major refactoring of the test scheduling system. What Was Expected (VSCode Integration):
What Actually Changed:
Technical Analysis✅ MSBuild Properties Changes (Good)Files:
|
|
@copilot undo the code changes and just keep the |
Co-authored-by: thomhurst <[email protected]>
Done! Reverted all code changes and kept only the .props file changes. Also removed EnableMSTestRunner references from the title/description. The solution now only adds the two essential MSBuild properties (UseTestingPlatformProtocol and IsTestingPlatformEnabled) plus the Microsoft.Testing.Platform.MSBuild package reference for VSCode test discovery integration. (363fc8f) |
VSCode's C# extension was not showing "play" button controls in the editor gutter for TUnit tests in version 0.5x. This prevented users from running individual tests directly from the editor, even with C# Dev Kit installed and "Use Testing Platform Protocol" enabled.
Root Cause
TUnit uses Microsoft.Testing.Platform instead of the legacy VSTest framework, but was missing specific MSBuild properties that VSCode's C# extension requires to recognize test projects and enable editor gutter integration.
Solution
Added two essential MSBuild properties to enable VSCode test discovery:
These properties were added to:
TUnit.Engine/TUnit.Engine.props- Core engine propertiesTUnit/TUnit.props- Main TUnit library propertiesTestProject.props- Template for all test projectsAlso added the
Microsoft.Testing.Platform.MSBuildpackage reference to ensure proper MSBuild integration.What This Fixes
After this change, VSCode users should see:
Impact
This is a minimal, non-breaking change that only adds the necessary properties for VSCode compatibility without affecting Visual Studio, Rider, or command-line usage.
Fixes #2856.
💡 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.