vstest icon indicating copy to clipboard operation
vstest copied to clipboard

VSTest.Console.exe support an option to handle DebugBreak as a failure and continue

Open kendrahavens opened this issue 3 years ago • 0 comments

Transferred from Developer community https://developercommunity.visualstudio.com/t/VSTestConsoleexe-support-an-option-to-/1635735

Description

If someone adds DebugBreak() call outside of IsDebuggerPresent() check, then VSTest.Console.exe will terminate with the currently active test method being flagged as “Skipped” and all remainder tests will be ignored.

Having a flag that handles DebugBreak() with Vectored Exception Handler and fails the test method, but more importantly continues with the execution of the next test method.

This impact applies to the command-line invocation and Visual Studio Text Explorer Run command.

We are planning on adding a linter check to scan for incorrect usage of DebugBreak() in our repos to resolve this issue. But, wanted to also reach out and suggest a feature improvement.

Instead of flagging the test method as “Skipped” but as “Failed” would also be a better approach than the current case.

kendrahavens avatar Mar 10 '22 01:03 kendrahavens