diff --git a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs index 83ba729400..fa8631ce02 100644 --- a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs +++ b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs @@ -43,11 +43,7 @@ namespace FunctionalTests ApplicationName = ApplicationName, PublishApplicationBeforeDeployment = true, TargetFramework = flavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", -#if DEBUG - Configuration = "Debug", -#else Configuration = "Release", -#endif EnvironmentVariables = { telemetryOptOut, diff --git a/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs b/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs new file mode 100644 index 0000000000..ca8658e8cf --- /dev/null +++ b/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs @@ -0,0 +1,54 @@ +// 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.Threading.Tasks; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.Extensions.Logging.Testing; +using Xunit; +using Xunit.Abstractions; + +namespace FunctionalTests +{ + public class PublishWithDebugTest_CoreCLR : + LoggedTest, IClassFixture + { + public PublishWithDebugTest_CoreCLR( + TestFixture fixture, + ITestOutputHelper output) + : base(output) + { + Fixture = fixture; + } + + public ApplicationTestFixture Fixture { get; } + + [Fact] + public async Task PublishingInDebugWorks() + { + using (StartLog(out var loggerFactory)) + { + // 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); + } + } + + public class TestFixture : CoreCLRApplicationTestFixture + { + protected override DeploymentParameters GetDeploymentParameters() + { + var deploymentParameters = base.GetDeploymentParameters(); + deploymentParameters.Configuration = "Debug"; + + return deploymentParameters; + } + } + } +} diff --git a/test/FunctionalTests/PublishWithDebugTest_Desktop.cs b/test/FunctionalTests/PublishWithDebugTest_Desktop.cs new file mode 100644 index 0000000000..22c940ddbd --- /dev/null +++ b/test/FunctionalTests/PublishWithDebugTest_Desktop.cs @@ -0,0 +1,57 @@ +// 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.Threading.Tasks; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.Extensions.Logging.Testing; +using Xunit; +using Xunit.Abstractions; + +namespace FunctionalTests +{ + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + public class PublishWithDebugTest_Desktop : + LoggedTest, IClassFixture + { + public PublishWithDebugTest_Desktop( + TestFixture fixture, + ITestOutputHelper output) + : base(output) + { + Fixture = fixture; + } + + public ApplicationTestFixture Fixture { get; } + + [ConditionalFact] + public async Task PublishingInDebugWorks() + { + using (StartLog(out var loggerFactory)) + { + // 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); + } + } + + public class TestFixture : DesktopApplicationTestFixture + { + protected override DeploymentParameters GetDeploymentParameters() + { + var deploymentParameters = base.GetDeploymentParameters(); + deploymentParameters.Configuration = "Debug"; + + return deploymentParameters; + } + } + } +} diff --git a/test/FunctionalTests/SimpleAppTest_CoreCLR.cs b/test/FunctionalTests/SimpleAppTest_CoreCLR.cs index 18e17b588e..da7756d3c9 100644 --- a/test/FunctionalTests/SimpleAppTest_CoreCLR.cs +++ b/test/FunctionalTests/SimpleAppTest_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.Extensions.Logging.Testing; using Xunit; @@ -38,5 +39,32 @@ namespace FunctionalTests TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); } } + + [Fact] + public async Task Precompilation_PreventsRefAssembliesFromBeingPublished() + { + using (StartLog(out var loggerFactory)) + { + // Arrange + var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); + + // Act & Assert + Assert.False(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); + } + } + + [Fact] + public async Task Precompilation_PublishesPdbsToOutputDirectory() + { + using (StartLog(out var loggerFactory)) + { + // Arrange + var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); + var pdbPath = Path.Combine(deployment.ContentRoot, Fixture.ApplicationName + ".PrecompiledViews.pdb"); + + // Act & Assert + Assert.True(File.Exists(pdbPath), $"PDB at {pdbPath} was not found."); + } + } } } diff --git a/test/FunctionalTests/SimpleAppTest_Desktop.cs b/test/FunctionalTests/SimpleAppTest_Desktop.cs index 45c1731287..2961f5479c 100644 --- a/test/FunctionalTests/SimpleAppTest_Desktop.cs +++ b/test/FunctionalTests/SimpleAppTest_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.Testing.xunit; using Microsoft.Extensions.Logging.Testing; @@ -41,5 +42,32 @@ namespace FunctionalTests TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); } } + + [ConditionalFact] + public async Task Precompilation_PreventsRefAssembliesFromBeingPublished() + { + using (StartLog(out var loggerFactory)) + { + // Arrange + var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); + + // Act & Assert + Assert.False(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); + } + } + + [ConditionalFact] + public async Task Precompilation_PublishesPdbsToOutputDirectory() + { + using (StartLog(out var loggerFactory)) + { + // Arrange + var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); + var pdbPath = Path.Combine(deployment.ContentRoot, Fixture.ApplicationName + ".PrecompiledViews.pdb"); + + // Act & Assert + Assert.True(File.Exists(pdbPath), $"PDB at {pdbPath} was not found."); + } + } } } diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs b/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs index ab4dc0d6e3..d4fc86f303 100644 --- a/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs +++ b/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs @@ -11,47 +11,6 @@ using Xunit.Abstractions; namespace FunctionalTests { - public class ViewCompilationOptions_CoreCLR : - LoggedTest, IClassFixture> - { - public ViewCompilationOptions_CoreCLR( - CoreCLRApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task Precompilation_PreventsRefAssembliesFromBeingPublished() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - Assert.False(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); - } - } - - [Fact] - public async Task Precompilation_PublishesPdbsToOutputDirectory() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var pdbPath = Path.Combine(deployment.ContentRoot, Fixture.ApplicationName + ".PrecompiledViews.pdb"); - - // Act & Assert - Assert.True(File.Exists(pdbPath), $"PDB at {pdbPath} was not found."); - } - } - } - public class ViewCompilationOptions_CoreCLR_ScenarioRefAssembliesDoNotGetPublished : LoggedTest, IClassFixture { diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs b/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs index e4a80533f1..abd3371446 100644 --- a/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs +++ b/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs @@ -12,49 +12,6 @@ using Xunit.Abstractions; namespace FunctionalTests { - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] - public class ViewCompilationOptions_Desktop : - LoggedTest, IClassFixture> - { - public ViewCompilationOptions_Desktop( - DesktopApplicationTestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_PreventsRefAssembliesFromBeingPublished() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - Assert.False(Directory.Exists(Path.Combine(deployment.ContentRoot, "refs"))); - } - } - - [ConditionalFact] - public async Task Precompilation_PublishesPdbsToOutputDirectory() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - var pdbPath = Path.Combine(deployment.ContentRoot, Fixture.ApplicationName + ".PrecompiledViews.pdb"); - - // Act & Assert - Assert.True(File.Exists(pdbPath), $"PDB at {pdbPath} was not found."); - } - } - } - [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] public class ViewCompilationOptions_Desktop_ScenarioRefAssembliesDoNotGetPublished :