-
Notifications
You must be signed in to change notification settings - Fork 280
Add MSTestSettings-based debugger launch on test failure #6166
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
base: main
Are you sure you want to change the base?
Conversation
…ation Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not edit anything under MSTest.Engine
.
Edit MSTEst settings (runsettings and testconfig) to be reading a new setting. Then edit all assertion so that they trigger the launch if enabled
… MSTest.Engine Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Updated the implementation to follow MSTest patterns correctly. Removed the MSTest.Engine extension and restructured to use proper MSTest settings for both runsettings and testconfig. The solution now:
All assertions now trigger through the settings-based approach instead of direct environment access. Commit: bc1b8ca |
…ation Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want you to add the settings to MSTestSettings
file not as a test run parameter. For the json counterpart (in the same file, in method SetSettingsFromConfig
, the entry should be under execution
).
global.json.backup
Outdated
@@ -0,0 +1,39 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the global.json.backup
file as requested. Commit: e4b6a3b
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Updated the implementation to add debugger launch settings directly to |
…chitecture Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
This PR implements a new MSTest feature that allows developers to automatically launch a debugger when test assertions fail. This is particularly useful for debugging intermittent or hard-to-reproduce test failures by preserving the exact program state at the moment of failure.
Implementation
The feature is controlled via MSTest configuration and has zero performance impact when disabled:
XML Configuration (runsettings):
JSON Configuration (testconfig.json):
Environment Variable Fallback:
Key Changes
MSTestSettings
: AddedLaunchDebuggerOnFailure
andDebuggerLaunchTestFilter
properties with XML and JSON parsing supportBenefits
Usage Example
This addresses the core requirements from the issue:
Fixes #2033.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.