-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] [Design mode] Invoking vstest.console with environment variables #2023
Conversation
…lizing VsTestConsoleWrapper
@@ -106,6 +107,13 @@ public void StartProcess(ConsoleParameters consoleParameters) | |||
|
|||
EqtTrace.Verbose("VsTestCommandLineWrapper: Process Start Info {0} {1}", info.FileName, info.Arguments); | |||
|
|||
#if NET451 | |||
info.EnvironmentVariables.Clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be IDictionary<string, string> instead? Looks like StringDictionary is pre generics from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -37,6 +38,16 @@ public ConsoleParameters(IFileHelper fileHelper) | |||
this.fileHelper = fileHelper; | |||
} | |||
|
|||
#if NET451 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this check
src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/ConsoleParameters.cs
Outdated
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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