Skip to content

Fix attachVS when used for debugging integration tests#15451

Merged
nohwnd merged 1 commit into
microsoft:mainfrom
nohwnd:fix-attach-vs
Mar 9, 2026
Merged

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

Conversation

@nohwnd

@nohwnd nohwnd commented Mar 9, 2026

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

nohwnd commented Mar 9, 2026

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
@nohwnd nohwnd enabled auto-merge (squash) March 9, 2026 11:22
@nohwnd nohwnd merged commit 94e4e42 into microsoft:main Mar 9, 2026
7 checks passed
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 <[email protected]>

* Apply suggestions from code review

* Update docs/contribute.md

Co-authored-by: Copilot <[email protected]>

* Update docs/contribute.md

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: nohwnd <[email protected]>
Co-authored-by: Jakub Jareš <[email protected]>
Co-authored-by: Copilot <[email protected]>
This was referenced May 26, 2026
This was referenced Jul 6, 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