Skip to content

Fix attachVS when used for debugging integration tests - #15451

Merged
Jakub Jareš (nohwnd) merged 1 commit into
microsoft:mainfrom
nohwnd:fix-attach-vs
Mar 9, 2026
Merged

Fix attachVS when used for debugging integration tests#15451
Jakub Jareš (nohwnd) merged 1 commit into
microsoft:mainfrom
nohwnd:fix-attach-vs

Conversation

@nohwnd

Copy link
Copy Markdown
Member

Description

You can specify
image

DebugVSTestConsole = true and similar values to data source attributes to debug tests in integration tests, avoiding manually juggling the projects etc.

This fixes how we resolve attach vs to automatically attach back to VS.

Copilot AI review requested due to automatic review settings March 9, 2026 10:59
@nohwnd

Copy link
Copy Markdown
Member Author

copilot is working on documenting this.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes how integration tests resolve and pass the AttachVS executable path so VS can auto-attach when debugging vstest.console from data-driven integration tests.

Changes:

  • Add a project reference to AttachVS from the TestUtilities project so the executable can be built/copied alongside tests.
  • Set VSTEST_DEBUG_ATTACHVS_PATH in IntegrationTestBase when debug settings are enabled, pointing to AttachVS.exe in the calling assembly’s output directory.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/Microsoft.TestPlatform.TestUtilities/Microsoft.TestPlatform.TestUtilities.csproj References AttachVS so the executable can be produced/available for integration-test debugging.
test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs Injects VSTEST_DEBUG_ATTACHVS_PATH based on the calling assembly’s output location.

Comment thread test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs
Copilot AI added a commit that referenced this pull request Mar 9, 2026
Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com>
@nohwnd
Jakub Jareš (nohwnd) enabled auto-merge (squash) March 9, 2026 11:22
@nohwnd
Jakub Jareš (nohwnd) merged commit 94e4e42 into microsoft:main Mar 9, 2026
7 checks passed
Jakub Jareš (nohwnd) added a commit that referenced this pull request Mar 9, 2026
* Initial plan

* Apply PR #15451 fix and document integration test debugging

Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com>

* Apply suggestions from code review

* Update docs/contribute.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/contribute.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com>
Co-authored-by: Jakub Jareš <me@jakubjares.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants