From 40bd6e560ec78953b689cef80b21d857dd181bc4 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Fri, 10 Nov 2017 10:07:19 -0800 Subject: [PATCH] Adds HostingModel as an extra DeploymentParameter (#1261) --- .../Common/DeploymentParameters.cs | 2 ++ .../Common/HostingModel.cs | 11 +++++++++++ .../Deployers/IISExpressDeployer.cs | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs index 4687f8f330..02b9c10cfa 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs @@ -106,6 +106,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting public string PublishedApplicationRootPath { get; set; } + public HostingModel HostingModel { get; set; } + /// /// Environment variables to be set before starting the host. /// Not applicable for IIS Scenarios. diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs new file mode 100644 index 0000000000..1eb1aea8c0 --- /dev/null +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs @@ -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 + } +} diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs index 077c4851db..2abdca658d 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs @@ -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))