Document debugging integration tests with AttachVS by Copilot · Pull Request #15452 · microsoft/vstest (original) (raw)

Integration tests spawn vstest.console and testhost as child processes, making them hard to debug. The DebugInfo properties on test data source attributes existed but AttachVS.exe wasn't automatically resolved, requiring manual setup.

Changes

Fix: Auto-resolve AttachVS.exe path

Docs: Debugging integration tests (docs/contribute.md)

Added a new section covering how to attach VS to child processes spawned by integration tests:

[TestMethod] [NetCoreRunner(AcceptanceTestBase.NET9, DebugVSTestConsole = true)] public void MyTest(RunnerInfo runnerInfo) { ... }

Property Process debugged Env var set
DebugVSTestConsole = true vstest.console VSTEST_RUNNER_DEBUG_ATTACHVS=1
DebugTestHost = true testhost VSTEST_HOST_DEBUG_ATTACHVS=1
DebugDataCollector = true data collector VSTEST_DATACOLLECTOR_DEBUG_ATTACHVS=1
DebugStopAtEntrypoint = true (keeps entry-point BP) suppresses VSTEST_DEBUG_NOBP=1

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.