Fix macos test discovery, update stale env var with process.env vars #2096
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempting to fix issue 2095, caused by #2091
#2091 introduced setting the
VSTEST_HOST_DEBUG=0env variable as part of thedotnet testexecution when not debugging, in order to clear stale values that may exist from previous debug runs. This was done by passing theVSTEST_HOST_DEBUG=0env var intochild_process.spawncall.It appears that
child_process.spawndefaults to usingprocess.envas its default env values, if nothing is passed in (see here). Therefore the change in #2091 effectively overwrote all of the defaultprocess.envvars with the singleVSTEST_HOST_DEBUGvar.I suspect this has caused test discovery on some platforms (perhaps only Mac) to fail. This PR will now append
VSTEST_HOST_DEBUGto theprocess.envenv 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.