Set DOTNET_ROOT in VSTestForwardingApp#13619
Merged
Merged
Conversation
When invoking dotnet test on an assembly, DOTNET_ROOT isn't set and the testhost will fail to find a matching shared framework. This only happens on Windows as the apphost feature is used there to differentiate between x86 and x64.
Member
Author
|
@nohwnd can you maybe help me validate this by adding a test? Unsure how tests work in this repo. |
ViktorHofer
commented
Sep 16, 2020
nohwnd
approved these changes
Sep 16, 2020
ViktorHofer
added a commit
that referenced
this pull request
Sep 16, 2020
* Set DOTNET_ROOT in VSTestForwardingApp When invoking dotnet test on an assembly, DOTNET_ROOT isn't set and the testhost will fail to find a matching shared framework. This only happens on Windows as the apphost feature is used there to differentiate between x86 and x64. * Add tests * Reuse GetRootVariable Co-authored-by: nohwnd <me@jakubjares.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Customer Impact
3.1 introduced support for using
dotnet testto invoke a test project or an assembly. This means thatdotnet vstestwhich was used to invoke a test assembly is de facto deprecated as it's replaced bydotnet test. Testing a test assembly withdotnet teston Windows results in the testhost (which uses the apphost feature) not being able to find the runtime becauseDOTNET_ROOTisn't set.Testing
The PR adds product tests. In addition to that we have coverage from "arcadified" repos like mono/linker.
Risk
Low. The touched path is already broken and the change only involves setting an environment variable.
The assumption is that this issue hasn't come up yet as the feature isn't documented yet and hence not many are using it. FWIW, Arcade uses it when using the VSTest runner instead of xunit.console (feature switch).
cc @nohwnd
Fixes #13611