Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Adds hosting model as an extra deployment parameter #1261

Merged
merged 7 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public DeploymentParameters(

public string PublishedApplicationRootPath { get; set; }

public HostingModel HostingModel { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Set a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@JunTaoLuo JunTaoLuo Nov 9, 2017

Choose a reason for hiding this comment

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

By default, it would take the first value as the default (or whatever is the enum equivalent of 0). Do we want to default all tests to InProcess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably should be out of process.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm okay with changing the order of the enums but personally I prefer the more explicit approach where we just set the default value. Takes out all ambiguity.


/// <summary>
/// Environment variables to be set before starting the host.
/// Not applicable for IIS Scenarios.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ public override async Task<DeploymentResult> DeployAsync()

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))
Expand Down