Adds HostingModel as an extra DeploymentParameter (#1261)

This commit is contained in:
Justin Kotalik 2017-11-10 10:07:19 -08:00 committed by GitHub
parent a78b9c7490
commit 40bd6e560e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -106,6 +106,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
public string PublishedApplicationRootPath { get; set; }
public HostingModel HostingModel { get; set; }
/// <summary>
/// Environment variables to be set before starting the host.
/// Not applicable for IIS Scenarios.

View File

@ -0,0 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Server.IntegrationTesting
{
public enum HostingModel
{
OutOfProcess,
InProcess
}
}

View File

@ -142,6 +142,13 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
DeploymentParameters.ServerConfigLocation = Path.GetTempFileName();
if (serverConfig.Contains("[HostingModel]"))
{
var hostingModel = DeploymentParameters.HostingModel.ToString();
serverConfig.Replace("[HostingModel]", hostingModel);
Logger.LogDebug("Writing HostingModel '{hostingModel}' to config", hostingModel);
}
Logger.LogDebug("Saving Config to {configPath}", DeploymentParameters.ServerConfigLocation);
if (Logger.IsEnabled(LogLevel.Trace))