[Draft] [Design mode] Invoking vstest.console with environment variables#2023
[Draft] [Design mode] Invoking vstest.console with environment variables#2023cltshivash merged 2 commits intomicrosoft:masterfrom
Conversation
…lizing VsTestConsoleWrapper
| EqtTrace.Verbose("VsTestCommandLineWrapper: Process Start Info {0} {1}", info.FileName, info.Arguments); | ||
|
|
||
| #if NET451 | ||
| info.EnvironmentVariables.Clear(); |
There was a problem hiding this comment.
Should we only clear if environment variables are supplied? Might affect other clients otherwise.
| /// TODO: Remove the #if when project is targeted to netstandard2.0 | ||
| /// Environment variables to be set for the process | ||
| /// </summary> | ||
| public StringDictionary EnvironmentVariables { get; set; } = new StringDictionary(); |
There was a problem hiding this comment.
Should this just be IDictionary<string, string> instead? Looks like StringDictionary is pre generics from here.
There was a problem hiding this comment.
| this.fileHelper = fileHelper; | ||
| } | ||
|
|
||
| #if NET451 |
There was a problem hiding this comment.
why do we need this check
| info.EnvironmentVariables.Clear(); | ||
| foreach (DictionaryEntry envVariable in consoleParameters.EnvironmentVariables) | ||
| { | ||
| info.EnvironmentVariables.Add(envVariable.Key.ToString(), envVariable.Value.ToString()); |
There was a problem hiding this comment.
envVariable.Value [](start = 74, length = 17)
u r assuming client will give non null values. handle that here
|
@singhsarab can you please share the issues. Also I'm not sure what is the requirement here, to start vstest.console under certain Env vars, or the goal is to move them to testhost.exe, & we are using vstest.console as intermediate to do so. Can you please confirm |
Description
Changes to allow clients to provide environment variable while initializing VsTestConsoleWrapper