Skip to content

Conversation

@rowanhwilliams
Copy link
Contributor

@rowanhwilliams rowanhwilliams commented Jul 17, 2025

Attempting to fix issue 2095, caused by #2091

#2091 introduced setting the VSTEST_HOST_DEBUG=0 env variable as part of the dotnet test execution when not debugging, in order to clear stale values that may exist from previous debug runs. This was done by passing the VSTEST_HOST_DEBUG=0 env var into child_process.spawn call.

It appears that child_process.spawn defaults to using process.env as its default env values, if nothing is passed in (see here). Therefore the change in #2091 effectively overwrote all of the default process.env vars with the single VSTEST_HOST_DEBUG var.

I suspect this has caused test discovery on some platforms (perhaps only Mac) to fail. This PR will now append VSTEST_HOST_DEBUG to the process.env env vars in the same way that is already done when debugging.

I don't have a Mac to verify this fix on, but suspect this will fix the issue.

Copy link
Member

@TheAngryByrd TheAngryByrd left a comment

Choose a reason for hiding this comment

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

Tested on my mac against FsToolkit.ErrorHandling and was able to discover/run/debug

@TheAngryByrd TheAngryByrd merged commit a287015 into ionide:main Jul 19, 2025
2 checks passed
@TheAngryByrd TheAngryByrd changed the title Fix 2095 update stale env var with process.env vars Fix macos test discovery, update stale env var with process.env vars Jul 19, 2025
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.

Test discovery fails in VS Code

2 participants