Use dictionary for deployment parameters (#1126)
This commit is contained in:
parent
07f96a444e
commit
456957bf57
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
ApplicationName = new DirectoryInfo(ApplicationPath).Name;
|
ApplicationName = new DirectoryInfo(ApplicationPath).Name;
|
||||||
ServerType = serverType;
|
ServerType = serverType;
|
||||||
RuntimeFlavor = runtimeFlavor;
|
RuntimeFlavor = runtimeFlavor;
|
||||||
EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_DETAILEDERRORS", "true"));
|
EnvironmentVariables["ASPNETCORE_DETAILEDERRORS"] = "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerType ServerType { get; }
|
public ServerType ServerType { get; }
|
||||||
|
|
@ -103,12 +103,12 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
/// Environment variables to be set before starting the host.
|
/// Environment variables to be set before starting the host.
|
||||||
/// Not applicable for IIS Scenarios.
|
/// Not applicable for IIS Scenarios.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<KeyValuePair<string, string>> EnvironmentVariables { get; } = new List<KeyValuePair<string, string>>();
|
public IDictionary<string, string> EnvironmentVariables { get; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Environment variables used when invoking dotnet publish.
|
/// Environment variables used when invoking dotnet publish.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<KeyValuePair<string, string>> PublishEnvironmentVariables { get; } = new List<KeyValuePair<string, string>>();
|
public IDictionary<string, string> PublishEnvironmentVariables { get; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For any application level cleanup to be invoked after performing host cleanup.
|
/// For any application level cleanup to be invoked after performing host cleanup.
|
||||||
|
|
@ -126,4 +126,4 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
PublishApplicationBeforeDeployment);
|
PublishApplicationBeforeDeployment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, List<KeyValuePair<string, string>> environmentVariables)
|
protected void AddEnvironmentVariablesToProcess(ProcessStartInfo startInfo, IDictionary<string, string> environmentVariables)
|
||||||
{
|
{
|
||||||
var environment = startInfo.Environment;
|
var environment = startInfo.Environment;
|
||||||
SetEnvironmentVariable(environment, "ASPNETCORE_ENVIRONMENT", DeploymentParameters.EnvironmentName);
|
SetEnvironmentVariable(environment, "ASPNETCORE_ENVIRONMENT", DeploymentParameters.EnvironmentName);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests
|
||||||
PublishApplicationBeforeDeployment = true
|
PublishApplicationBeforeDeployment = true
|
||||||
};
|
};
|
||||||
|
|
||||||
deploymentParameters.EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_STARTMECHANIC", "Run"));
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_STARTMECHANIC"] = "Run";
|
||||||
|
|
||||||
using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory))
|
using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory))
|
||||||
{
|
{
|
||||||
|
|
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Hosting.FunctionalTests
|
||||||
PublishApplicationBeforeDeployment = true
|
PublishApplicationBeforeDeployment = true
|
||||||
};
|
};
|
||||||
|
|
||||||
deploymentParameters.EnvironmentVariables.Add(new KeyValuePair<string, string>("ASPNETCORE_STARTMECHANIC", "WaitForShutdown"));
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_STARTMECHANIC"] = "WaitForShutdown";
|
||||||
|
|
||||||
using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory))
|
using (var deployer = new SelfHostDeployer(deploymentParameters, loggerFactory))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue