From 7f1a987adaf246e03ffd1a58ab75b5e09b8d9b00 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 15 Nov 2017 11:03:08 -0800 Subject: [PATCH] Update samples and tests to target netcoreapp2.1 --- Directory.Build.props | 4 +++ build/dependencies.props | 24 ++++++------- korebuild-lock.txt | 4 +-- test/Directory.Build.props | 7 ++++ ...cationConsumingPrecompiledViews_CoreCLR.cs | 0 ...plicationUsingRelativePathsTest_CoreCLR.cs | 0 ...ApplicationWithConfigureMvcTest_CoreCLR.cs | 0 ...icationWithCustomInputFilesTest_CoreCLR.cs | 0 .../ApplicationWithParseErrorsTest_CoreCLR.cs | 0 .../ApplicationWithTagHelpersTest_CoreCLR.cs | 0 ...pyBuildOutputToPublishDirectory_CoreCLR.cs | 0 ...utSymbolsToPublishDirectoryTest_CoreCLR.cs | 0 .../CoreCLRApplicationTestFixture.cs | 11 +++++- .../PublishForRidTest_CoreCLR.cs | 19 ++++++---- .../PublishWithDebugTest_CoreCLR.cs | 14 ++++---- ...PublishWithEmbedViewSourcesTest_CoreCLR.cs | 0 .../RazorPagesAppTest_CoreCLR.cs | 0 .../SimpleAppTest_CoreCLR.cs | 0 ...SimpleAppWithAssemblyRenameTest_CoreCLR.cs | 0 .../StrongNamedAppTest_CoreCLR.cs | 0 .../ViewCompilationOptionsTest_CoreCLR.cs | 0 ...cationConsumingPrecompiledViews_Desktop.cs | 0 ...plicationUsingRelativePathsTest_Desktop.cs | 0 ...ApplicationWithConfigureMvcTest_Desktop.cs | 0 ...icationWithCustomInputFilesTest_Desktop.cs | 0 .../ApplicationWithParseErrorsTest_Desktop.cs | 0 .../ApplicationWithTagHelpersTest_Desktop.cs | 0 ...ildOutputToPublishDirectoryTest_Desktop.cs | 0 ...utSymbolsToPublishDirectoryTest_Desktop.cs | 0 .../DesktopApplicationTestFixture.cs | 2 +- .../PublishWithDebugTest_Desktop.cs | 17 +++++---- ...PublishWithEmbedViewSourcesTest_Desktop.cs | 0 .../RazorPagesAppTest_Desktop.cs | 0 .../SimpleAppTest_Desktop.cs | 0 ...SimpleAppWithAssemblyRenameTest_Desktop.cs | 0 .../StrongNamedAppTest_Desktop.cs | 0 .../ViewCompilationOptionsTest_Desktop.cs | 0 test/FunctionalTests/FunctionalTests.csproj | 8 ++++- .../Infrastructure/ApplicationTestFixture.cs | 36 +++++++++++++------ ...Core.Mvc.Razor.ViewCompilation.Test.csproj | 3 +- ...ionUsingPrecompiledViewClassLibrary.csproj | 3 +- .../ApplicationUsingRelativePaths.csproj | 3 +- .../ApplicationWithConfigureMvc.csproj | 3 +- .../ApplicationWithCustomInputFiles.csproj | 3 +- .../ApplicationWithParseErrors.csproj | 3 +- .../ApplicationWithTagHelpers.csproj | 3 +- .../ClassLibraryTagHelper.csproj | 3 +- .../ClassLibraryWithPrecompiledViews.csproj | 4 +-- testapps/Directory.Build.props | 7 ++++ testapps/Directory.Build.targets | 11 +++--- .../PublishWithEmbedViewSources.csproj | 3 +- testapps/RazorPagesApp/RazorPagesApp.csproj | 3 +- testapps/SimpleApp/SimpleApp.csproj | 3 +- .../SimpleAppWithAssemblyRename.csproj | 3 +- testapps/StrongNamedApp/StrongNamedApp.csproj | 3 +- 55 files changed, 125 insertions(+), 82 deletions(-) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationConsumingPrecompiledViews_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationUsingRelativePathsTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationWithConfigureMvcTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationWithCustomInputFilesTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationWithParseErrorsTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ApplicationWithTagHelpersTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/CopyBuildOutputToPublishDirectory_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs (100%) rename test/FunctionalTests/{Infrastructure => CoreCLRTests}/CoreCLRApplicationTestFixture.cs (71%) rename test/FunctionalTests/{ => CoreCLRTests}/PublishForRidTest_CoreCLR.cs (88%) rename test/FunctionalTests/{ => CoreCLRTests}/PublishWithDebugTest_CoreCLR.cs (81%) rename test/FunctionalTests/{ => CoreCLRTests}/PublishWithEmbedViewSourcesTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/RazorPagesAppTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/SimpleAppTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/SimpleAppWithAssemblyRenameTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/StrongNamedAppTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => CoreCLRTests}/ViewCompilationOptionsTest_CoreCLR.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationConsumingPrecompiledViews_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationUsingRelativePathsTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationWithConfigureMvcTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationWithCustomInputFilesTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationWithParseErrorsTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ApplicationWithTagHelpersTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/CopyBuildOutputToPublishDirectoryTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs (100%) rename test/FunctionalTests/{Infrastructure => DesktopTests}/DesktopApplicationTestFixture.cs (90%) rename test/FunctionalTests/{ => DesktopTests}/PublishWithDebugTest_Desktop.cs (79%) rename test/FunctionalTests/{ => DesktopTests}/PublishWithEmbedViewSourcesTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/RazorPagesAppTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/SimpleAppTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/SimpleAppWithAssemblyRenameTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/StrongNamedAppTest_Desktop.cs (100%) rename test/FunctionalTests/{ => DesktopTests}/ViewCompilationOptionsTest_Desktop.cs (100%) diff --git a/Directory.Build.props b/Directory.Build.props index d875d2bcb9..3ecf4afdd9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,8 @@  + + diff --git a/build/dependencies.props b/build/dependencies.props index 2f9e96ca98..775eb2d4d9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,20 +4,20 @@ 2.1.0-preview1-15551 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 0.5.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 15.3.409 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 + 2.1.0-preview1-27579 2.0.0 15.3.0 2.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 86352477bb..95f4613014 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15551 -commithash:8fad9553b48533fddbb16a423ea55b9710ea2e63 +version:2.1.0-preview1-15567 +commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index c867cbd112..7ec143f84d 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,6 +1,13 @@  + + netcoreapp2.1 + $(DeveloperBuildTestTfms) + netcoreapp2.1;netcoreapp2.0 + $(StandardTestTfms);net461 + + diff --git a/test/FunctionalTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationUsingRelativePathsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationUsingRelativePathsTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationUsingRelativePathsTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationUsingRelativePathsTest_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationWithConfigureMvcTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithConfigureMvcTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationWithParseErrorsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithParseErrorsTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationWithTagHelpersTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithTagHelpersTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs diff --git a/test/FunctionalTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs diff --git a/test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs diff --git a/test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs b/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs similarity index 71% rename from test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs rename to test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs index 6f4c8625df..d429b08de1 100644 --- a/test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs +++ b/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs @@ -7,6 +7,15 @@ namespace FunctionalTests { public class CoreCLRApplicationTestFixture : ApplicationTestFixture { + private const string TargetFramework = +#if NETCOREAPP2_0 + "netcoreapp2.0"; +#elif NETCOREAPP2_1 + "netcoreapp2.1"; +#else +#error Target frameworks need to be updated +#endif + public CoreCLRApplicationTestFixture() : this(typeof(TStartup).Assembly.GetName().Name, null) { @@ -17,6 +26,6 @@ namespace FunctionalTests { } - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr); + protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr, TargetFramework); } } diff --git a/test/FunctionalTests/PublishForRidTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs similarity index 88% rename from test/FunctionalTests/PublishForRidTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs index fdbdcc96cd..48dec3c965 100644 --- a/test/FunctionalTests/PublishForRidTest_CoreCLR.cs +++ b/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs @@ -29,10 +29,17 @@ namespace FunctionalTests var applicationName = nameof(SimpleApp); var applicationPath = ApplicationPaths.GetTestAppDirectory(applicationName); var deploymentParameters = ApplicationTestFixture.GetDeploymentParameters( - applicationPath, - applicationName, - RuntimeFlavor.CoreClr); - + applicationPath, + applicationName, + RuntimeFlavor.CoreClr, +#if NETCOREAPP2_0 + "netcoreapp2.0"); +#elif NETCOREAPP2_1 + "netcoreapp2.1"); +#else +#error Target frameworks need to be updated +#endif + // Deploy for a rid that does not exist on the current platform. if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -49,7 +56,7 @@ namespace FunctionalTests // Act var expectedFile = Path.Combine( - deploymentParameters.PublishedApplicationRootPath, + deploymentParameters.PublishedApplicationRootPath, $"{applicationName}.PrecompiledViews.dll"); Assert.True(File.Exists(expectedFile), $"Expected precompiled file {expectedFile} does not exist."); } @@ -57,7 +64,7 @@ namespace FunctionalTests private class DotNetPublishDeployer : ApplicationDeployer { - public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) + public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) : base(deploymentParameters, loggerFactory) { } diff --git a/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs similarity index 81% rename from test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs index ca8658e8cf..c66e4b68a5 100644 --- a/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs +++ b/test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs @@ -1,6 +1,7 @@ // 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 System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.Extensions.Logging.Testing; @@ -30,18 +31,19 @@ namespace FunctionalTests // Arrange var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - // Assert - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); + var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll"); + Assert.True(File.Exists(expected), $"File {expected} does not exist."); } } public class TestFixture : CoreCLRApplicationTestFixture { + public TestFixture() + { + PublishOnly = true; + } + protected override DeploymentParameters GetDeploymentParameters() { var deploymentParameters = base.GetDeploymentParameters(); diff --git a/test/FunctionalTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs diff --git a/test/FunctionalTests/RazorPagesAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/RazorPagesAppTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs diff --git a/test/FunctionalTests/SimpleAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/SimpleAppTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs diff --git a/test/FunctionalTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs diff --git a/test/FunctionalTests/StrongNamedAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/StrongNamedAppTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs similarity index 100% rename from test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs rename to test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs diff --git a/test/FunctionalTests/ApplicationConsumingPrecompiledViews_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationConsumingPrecompiledViews_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationConsumingPrecompiledViews_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationConsumingPrecompiledViews_Desktop.cs diff --git a/test/FunctionalTests/ApplicationUsingRelativePathsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationUsingRelativePathsTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationUsingRelativePathsTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationUsingRelativePathsTest_Desktop.cs diff --git a/test/FunctionalTests/ApplicationWithConfigureMvcTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithConfigureMvcTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs diff --git a/test/FunctionalTests/ApplicationWithCustomInputFilesTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithCustomInputFilesTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs diff --git a/test/FunctionalTests/ApplicationWithParseErrorsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithParseErrorsTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs diff --git a/test/FunctionalTests/ApplicationWithTagHelpersTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ApplicationWithTagHelpersTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs diff --git a/test/FunctionalTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs diff --git a/test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs diff --git a/test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs b/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs similarity index 90% rename from test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs rename to test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs index 7e3579a017..a95dc59e7f 100644 --- a/test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs +++ b/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs @@ -17,6 +17,6 @@ namespace FunctionalTests { } - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr); + protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr, "net461"); } } diff --git a/test/FunctionalTests/PublishWithDebugTest_Desktop.cs b/test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs similarity index 79% rename from test/FunctionalTests/PublishWithDebugTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs index 22c940ddbd..0bc3ddb6ae 100644 --- a/test/FunctionalTests/PublishWithDebugTest_Desktop.cs +++ b/test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs @@ -1,6 +1,7 @@ // 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 System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; @@ -26,6 +27,7 @@ namespace FunctionalTests public ApplicationTestFixture Fixture { get; } [ConditionalFact] + [Fact] public async Task PublishingInDebugWorks() { using (StartLog(out var loggerFactory)) @@ -33,18 +35,19 @@ namespace FunctionalTests // Arrange var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - // Act - var response = await deployment.HttpClient.GetStringWithRetryAsync( - deployment.ApplicationBaseUri, - loggerFactory.CreateLogger(Fixture.ApplicationName)); - // Assert - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); + var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll"); + Assert.True(File.Exists(expected), $"File {expected} does not exist."); } } - public class TestFixture : DesktopApplicationTestFixture + public class TestFixture : CoreCLRApplicationTestFixture { + public TestFixture() + { + PublishOnly = true; + } + protected override DeploymentParameters GetDeploymentParameters() { var deploymentParameters = base.GetDeploymentParameters(); diff --git a/test/FunctionalTests/PublishWithEmbedViewSourcesTest_Desktop.cs b/test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/PublishWithEmbedViewSourcesTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs diff --git a/test/FunctionalTests/RazorPagesAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/RazorPagesAppTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs diff --git a/test/FunctionalTests/SimpleAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/SimpleAppTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs diff --git a/test/FunctionalTests/SimpleAppWithAssemblyRenameTest_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/SimpleAppWithAssemblyRenameTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs diff --git a/test/FunctionalTests/StrongNamedAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/StrongNamedAppTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs similarity index 100% rename from test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs rename to test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs diff --git a/test/FunctionalTests/FunctionalTests.csproj b/test/FunctionalTests/FunctionalTests.csproj index 29ab9c4118..2ea5cec310 100644 --- a/test/FunctionalTests/FunctionalTests.csproj +++ b/test/FunctionalTests/FunctionalTests.csproj @@ -1,15 +1,21 @@  - netcoreapp2.0 + netcoreapp2.1 + $(TargetFrameworks);netcoreapp2.0 + $(DefineConstants);__remove_this_to__GENERATE_BASELINES $(DefineConstants);GENERATE_BASELINES false false + false + + + diff --git a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs index 051f4cf2b6..56e988e05f 100644 --- a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs +++ b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.Extensions.Logging; @@ -12,7 +13,7 @@ namespace FunctionalTests public abstract class ApplicationTestFixture : IDisposable { private const string DotnetCLITelemetryOptOut = "DOTNET_CLI_TELEMETRY_OPTOUT"; - private readonly object _deploymentLock = new object(); + private static readonly SemaphoreSlim _deploymentLock = new SemaphoreSlim(initialCount: 1); private Task _deploymentTask; private IApplicationDeployer _deployer; @@ -30,14 +31,20 @@ namespace FunctionalTests protected abstract DeploymentParameters GetDeploymentParameters(); - protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor) - => GetDeploymentParameters(ApplicationPath, ApplicationName, flavor); + protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor, string targetFramework) + => GetDeploymentParameters(ApplicationPath, ApplicationName, flavor, targetFramework); - public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor) + public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor, string targetFramework) { - var telemetryOptOut = new KeyValuePair( - DotnetCLITelemetryOptOut, - "1"); + // This determines the configuration of the the test project and consequently the configuration the src projects are most likely built in. + var projectConfiguration = +#if DEBUG + "Debug"; +#elif RELEASE + "Release"; +#else +#error Unknown configuration +#endif var deploymentParameters = new DeploymentParameters( applicationPath, @@ -47,16 +54,18 @@ namespace FunctionalTests { ApplicationName = applicationName, PublishApplicationBeforeDeployment = true, - TargetFramework = flavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", Configuration = "Release", EnvironmentVariables = { - telemetryOptOut, + new KeyValuePair(DotnetCLITelemetryOptOut, "1"), + new KeyValuePair("SolutionConfiguration", projectConfiguration), }, PublishEnvironmentVariables = { - telemetryOptOut, + new KeyValuePair(DotnetCLITelemetryOptOut, "1"), + new KeyValuePair("SolutionConfiguration", projectConfiguration), }, + TargetFramework = targetFramework, }; return deploymentParameters; @@ -74,8 +83,9 @@ namespace FunctionalTests public async Task CreateDeploymentAsync(ILoggerFactory loggerFactory) { - lock (_deploymentLock) + try { + await _deploymentLock.WaitAsync(TimeSpan.FromSeconds(10)); if (_deploymentTask == null) { var deploymentParameters = GetDeploymentParameters(); @@ -91,6 +101,10 @@ namespace FunctionalTests _deploymentTask = _deployer.DeployAsync(); } } + finally + { + _deploymentLock.Release(); + } return await _deploymentTask; } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj b/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj index 74c0b9d161..06337dac6a 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj +++ b/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) diff --git a/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj b/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj index 9478314e47..631f5900b1 100644 --- a/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj +++ b/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) ..\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj diff --git a/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj b/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj index 85a0a8df38..f330f2386d 100644 --- a/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj +++ b/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true diff --git a/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj b/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj index 4aee9fb627..f27f45283b 100644 --- a/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj +++ b/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true $(DefineConstants);TEST123 diff --git a/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj b/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj index 95c4f130ad..f9904ee766 100644 --- a/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj +++ b/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true true diff --git a/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj b/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj index 85a0a8df38..f330f2386d 100644 --- a/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj +++ b/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true diff --git a/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj b/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj index c6c8b6e41c..d86ac254e6 100644 --- a/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj +++ b/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true diff --git a/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj b/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj index f536697188..309df3008e 100644 --- a/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj +++ b/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj @@ -1,8 +1,7 @@  - netstandard2.0;net461 - netstandard2.0 + netstandard2.0 diff --git a/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj b/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj index 4ba7c2f5c3..b0e5e2f417 100644 --- a/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj +++ b/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj @@ -1,14 +1,14 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) obj\precompiled\$(TargetFramework) true + diff --git a/testapps/Directory.Build.props b/testapps/Directory.Build.props index 0094c38ae4..35e9c46835 100644 --- a/testapps/Directory.Build.props +++ b/testapps/Directory.Build.props @@ -1,6 +1,13 @@ + + netcoreapp2.1 + $(DeveloperBuildTestAppTfms) + netcoreapp2.1;netcoreapp2.0 + $(StandardTestAppTfms);net461 + + 1.0.0 diff --git a/testapps/Directory.Build.targets b/testapps/Directory.Build.targets index a56638ed5c..4b805513d6 100644 --- a/testapps/Directory.Build.targets +++ b/testapps/Directory.Build.targets @@ -4,23 +4,20 @@ <_MvcViewCompilationAddDesktopReferences>false $(MvcRazorCompileOnPublish) - <_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll + $(Configuration) + <_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(SolutionConfiguration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll - - - - - <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll - <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe + <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'!='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\netcoreapp2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll + <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\net461\win7-x86\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe diff --git a/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj b/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj index 9f3dc47490..1362dd84ec 100644 --- a/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj +++ b/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true true diff --git a/testapps/RazorPagesApp/RazorPagesApp.csproj b/testapps/RazorPagesApp/RazorPagesApp.csproj index 9c7c5ab6b0..5ab7219211 100644 --- a/testapps/RazorPagesApp/RazorPagesApp.csproj +++ b/testapps/RazorPagesApp/RazorPagesApp.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true diff --git a/testapps/SimpleApp/SimpleApp.csproj b/testapps/SimpleApp/SimpleApp.csproj index f5f65c45ca..f57d869aeb 100644 --- a/testapps/SimpleApp/SimpleApp.csproj +++ b/testapps/SimpleApp/SimpleApp.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) win7-x86;debian-x64 true diff --git a/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj b/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj index bee405d99b..1a8db3562d 100644 --- a/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj +++ b/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj @@ -2,8 +2,7 @@ NewAssemblyName - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true diff --git a/testapps/StrongNamedApp/StrongNamedApp.csproj b/testapps/StrongNamedApp/StrongNamedApp.csproj index d72479411d..9691746590 100644 --- a/testapps/StrongNamedApp/StrongNamedApp.csproj +++ b/testapps/StrongNamedApp/StrongNamedApp.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestAppTfms) true true true