Skip to content
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

Merged
merged 2 commits into from
May 29, 2019

Conversation

singhsarab
Copy link
Contributor

@singhsarab singhsarab commented May 23, 2019

Description

Changes to allow clients to provide environment variable while initializing 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();
Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree


In reply to: 287176793 [](ancestors = 287176793)

@@ -37,6 +38,16 @@ public ConsoleParameters(IFileHelper fileHelper)
this.fileHelper = fileHelper;
}

#if NET451
Copy link
Contributor

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

info.EnvironmentVariables.Clear();
foreach (DictionaryEntry envVariable in consoleParameters.EnvironmentVariables)
{
info.EnvironmentVariables.Add(envVariable.Key.ToString(), envVariable.Value.ToString());
Copy link
Contributor

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

acesiddhu
acesiddhu previously approved these changes May 24, 2019
@acesiddhu acesiddhu dismissed their stale review May 24, 2019 06:47

revoking review

@mayankbansal018
Copy link
Contributor

@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

@cltshivash cltshivash merged commit 7d28e20 into microsoft:master May 29, 2019
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.

5 participants