diff --git a/build/dependencies.props b/build/dependencies.props index 9241c0e315..aeef4f5704 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -27,7 +27,6 @@ 2.2.0-preview1-34203 2.2.0-preview1-34203 2.2.0-preview1-34203 - 0.6.0-preview1-34203 2.2.0-preview1-34203 2.2.0-preview1-34203 2.2.0-preview1-34203 diff --git a/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj b/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj index 7643b26c78..d657e5bfe9 100644 --- a/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj +++ b/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj @@ -22,7 +22,6 @@ - diff --git a/test/AuthSamples.FunctionalTests/TestServices.cs b/test/AuthSamples.FunctionalTests/TestServices.cs deleted file mode 100644 index f361830e35..0000000000 --- a/test/AuthSamples.FunctionalTests/TestServices.cs +++ /dev/null @@ -1,93 +0,0 @@ -// 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. - -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging; -using System; -using System.IO; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Xunit.Sdk; - -namespace AuthSamples.FunctionalTests -{ - public static class TestServices - { - public static string WorkingDirectory { get; } = AppContext.BaseDirectory; - - public static void LogResponseOnFailedAssert(this ILogger logger, HttpResponseMessage response, string responseText, Action assert) - { - try - { - assert(); - } - catch (XunitException) - { - logger.LogWarning(response.ToString()); - if (!string.IsNullOrEmpty(responseText)) - { - logger.LogWarning(responseText); - } - throw; - } - } - - public static async Task RunSiteTest( - string siteName, - ServerType serverType, - RuntimeFlavor runtimeFlavor, - RuntimeArchitecture architecture, - ApplicationType applicationType, - ILoggerFactory loggerFactory, - Func validator) - { - var logger = loggerFactory.CreateLogger(siteName); - var targetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.2"; - - var deploymentParameters = new DeploymentParameters(GetApplicationDirectory(siteName), serverType, runtimeFlavor, architecture) - { - SiteName = "HttpTestSite", - ServerConfigTemplateContent = serverType == ServerType.Nginx ? File.ReadAllText(Path.Combine(WorkingDirectory, "nginx.conf")) : string.Empty, - PublishApplicationBeforeDeployment = true, - TargetFramework = targetFramework, - ApplicationType = applicationType - }; - - using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory)) - { - logger.LogInformation($"Running deployment for {siteName}:{serverType}:{runtimeFlavor}:{architecture}"); - var deploymentResult = await deployer.DeployAsync(); - deploymentResult.HttpClient.Timeout = TimeSpan.FromSeconds(10); - - logger.LogInformation($"Running validation for {siteName}:{serverType}:{runtimeFlavor}:{architecture}"); - await validator(deploymentResult.HttpClient, logger, deploymentResult.HostShutdownToken); - } - } - - public static string GetApplicationDirectory(string applicationName) - { - var solutionRoot = GetSolutionDirectory(); - return Path.Combine(solutionRoot, "samples", applicationName); - } - - public static string GetSolutionDirectory() - { - var applicationBasePath = AppContext.BaseDirectory; - var directoryInfo = new DirectoryInfo(applicationBasePath); - do - { - var solutionFile = new FileInfo(Path.Combine(directoryInfo.FullName, "AuthSamples.sln")); - if (solutionFile.Exists) - { - return directoryInfo.FullName; - } - - directoryInfo = directoryInfo.Parent; - } - while (directoryInfo.Parent != null); - - throw new Exception($"Solution root could not be located using application root {applicationBasePath}."); - } - } -}