diff --git a/test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs deleted file mode 100644 index f5177af2686b103b411a93db0186961b0952a16c..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs +++ /dev/null @@ -1,60 +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 System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class CopyBuildOutputToPublishDirectory_CoreCLR : - LoggedTest, IClassFixture<CopyBuildOutputToPublishDirectory_CoreCLR.TestFixture> - { - public CopyBuildOutputToPublishDirectory_CoreCLR( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact] - public async Task PublishingWithOption_SkipsPublishingPrecompiledDll() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - var dllFile = Path.Combine(deployment.ContentRoot, "SimpleApp.PrecompiledViews.dll"); - var pdbFile = Path.ChangeExtension(dllFile, ".pdb"); - Assert.False(File.Exists(dllFile), $"{dllFile} exists at deployment."); - Assert.True(File.Exists(pdbFile), $"{pdbFile} does not exist at deployment."); - } - } - - public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup> - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair<string, string>("CopyBuildOutputToPublishDirectory", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs deleted file mode 100644 index d4ab88d0d47300d9f96006ac5c81f78fa1846e59..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs +++ /dev/null @@ -1,60 +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 System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class CopyOutputSymbolsToPublishDirectoryTest_CoreCLR : - LoggedTest, IClassFixture<CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.TestFixture> - { - public CopyOutputSymbolsToPublishDirectoryTest_CoreCLR( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [Fact(Skip = "Unblocking the build: https://github.com/aspnet/MvcPrecompilation/issues/225")] - public async Task PublishingWithOption_SkipsPublishingPdb() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - var dllFile = Path.Combine(deployment.ContentRoot, "SimpleApp.PrecompiledViews.dll"); - var pdbFile = Path.ChangeExtension(dllFile, ".pdb"); - Assert.True(File.Exists(dllFile), $"{dllFile} does not exist at deployment."); - Assert.False(File.Exists(pdbFile), $"{pdbFile} exists at deployment."); - } - } - - public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup> - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair<string, string>("CopyOutputSymbolsToPublishDirectory", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs deleted file mode 100644 index 48dec3c965334598c36d9ad6b7ad4ee7485a60fa..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs +++ /dev/null @@ -1,79 +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 System; -using System.IO; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Testing; -using Xunit; -using Xunit.Abstractions; - -namespace FunctionalTests -{ - public class PublishWithRidTest_CoreCLR : LoggedTest - { - public PublishWithRidTest_CoreCLR(ITestOutputHelper output) - : base(output) - { - } - - [Fact] - public void CrossPublishingWorks() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var applicationName = nameof(SimpleApp); - var applicationPath = ApplicationPaths.GetTestAppDirectory(applicationName); - var deploymentParameters = ApplicationTestFixture.GetDeploymentParameters( - 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)) - { - deploymentParameters.AdditionalPublishParameters = "-r debian-x64"; - } - else - { - deploymentParameters.AdditionalPublishParameters = "-r win7-x86"; - } - var deployer = new DotNetPublishDeployer(deploymentParameters, loggerFactory); - - // Act - deployer.DotnetPublish(); - - // Act - var expectedFile = Path.Combine( - deploymentParameters.PublishedApplicationRootPath, - $"{applicationName}.PrecompiledViews.dll"); - Assert.True(File.Exists(expectedFile), $"Expected precompiled file {expectedFile} does not exist."); - } - } - - private class DotNetPublishDeployer : ApplicationDeployer - { - public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) - : base(deploymentParameters, loggerFactory) - { - } - - public void DotnetPublish() => base.DotnetPublish(); - - public override void Dispose() => CleanPublishedOutput(); - - public override Task<DeploymentResult> DeployAsync() => throw new NotSupportedException(); - } - } -} diff --git a/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs index c7affc3b10c853a37b80048d5f5351e6b029739a..9b90c31a178bc480f2782bac7c54cf73828e649b 100644 --- a/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs +++ b/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs @@ -39,32 +39,5 @@ namespace FunctionalTests TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); } } - - [Fact(Skip = "Unblocking the build - https://github.com/aspnet/MvcPrecompilation/issues/224")] - 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(Skip = "Unblocking the build - https://github.com/aspnet/MvcPrecompilation/issues/224")] - 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/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs deleted file mode 100644 index 51d01d603f0b00cb59eddebae004eeb10fe987db..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs +++ /dev/null @@ -1,63 +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 System.Collections.Generic; -using System.IO; -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 CopyBuildOutputToPublishDirectoryTest_Desktop : - LoggedTest, IClassFixture<CopyBuildOutputToPublishDirectoryTest_Desktop.TestFixture> - { - public CopyBuildOutputToPublishDirectoryTest_Desktop( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task PublishingWithOption_SkipsPublishingPrecompiledDll() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - var dllFile = Path.Combine(deployment.ContentRoot, "SimpleApp.PrecompiledViews.dll"); - var pdbFile = Path.ChangeExtension(dllFile, ".pdb"); - Assert.False(File.Exists(dllFile), $"{dllFile} exists at deployment."); - Assert.True(File.Exists(pdbFile), $"{pdbFile} does not exist at deployment."); - } - } - - public class TestFixture : DesktopApplicationTestFixture<SimpleApp.Startup> - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair<string, string>("CopyBuildOutputToPublishDirectory", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs deleted file mode 100644 index d01e5d9e88b7955e9249fefedb06a56ebf50d20a..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs +++ /dev/null @@ -1,63 +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 System.Collections.Generic; -using System.IO; -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 CopyOutputSymbolsToPublishDirectoryTest_Desktop : - LoggedTest, IClassFixture<CopyOutputSymbolsToPublishDirectoryTest_Desktop.TestFixture> - { - public CopyOutputSymbolsToPublishDirectoryTest_Desktop( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact(Skip = "Unblocking the build: https://github.com/aspnet/MvcPrecompilation/issues/225")] - public async Task PublishingWithOption_SkipsPublishingPdb() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - var dllFile = Path.Combine(deployment.ContentRoot, "SimpleApp.PrecompiledViews.dll"); - var pdbFile = Path.ChangeExtension(dllFile, ".pdb"); - Assert.True(File.Exists(dllFile), $"{dllFile} does not exist at deployment."); - Assert.False(File.Exists(pdbFile), $"{pdbFile} exists at deployment."); - } - } - - public class TestFixture : DesktopApplicationTestFixture<SimpleApp.Startup> - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.PublishEnvironmentVariables.Add( - new KeyValuePair<string, string>("CopyOutputSymbolsToPublishDirectory", "false")); - - return deploymentParameters; - } - } - } -} diff --git a/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs index db24e47c253da091a53b3088e233c198856e1d50..fb70a5a53ebcd02a4801e08d999c1991caa6a2ef 100644 --- a/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs +++ b/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs @@ -42,32 +42,5 @@ namespace FunctionalTests TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response); } } - - [ConditionalFact(Skip = "Unblocking the build - https://github.com/aspnet/MvcPrecompilation/issues/224")] - 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(Skip = "Unblocking the build - https://github.com/aspnet/MvcPrecompilation/issues/224")] - 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/DesktopTests/SimpleAppTest_WithAnyCPU_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppTest_WithAnyCPU_Desktop.cs deleted file mode 100644 index 4e114ff21845e26155a859d43c729dc0e5c03419..0000000000000000000000000000000000000000 --- a/test/FunctionalTests/DesktopTests/SimpleAppTest_WithAnyCPU_Desktop.cs +++ /dev/null @@ -1,58 +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 System.IO; -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 | OperatingSystems.MacOSX)] - public class SimpleAppTest_WithAnyCPU_Desktop : - LoggedTest, IClassFixture<SimpleAppTest_WithAnyCPU_Desktop.TestFixture> - { - public SimpleAppTest_WithAnyCPU_Desktop( - TestFixture fixture, - ITestOutputHelper output) - : base(output) - { - Fixture = fixture; - } - - public ApplicationTestFixture Fixture { get; } - - [ConditionalFact] - public async Task Precompilation_WorksForSimpleApps_BuiltWithPlatformTargetAnyCPU() - { - using (StartLog(out var loggerFactory)) - { - // Arrange - var deployment = await Fixture.CreateDeploymentAsync(loggerFactory); - - // Act & Assert - var dllFile = Path.Combine(deployment.ContentRoot, "SimpleApp.PrecompiledViews.dll"); - Assert.True(File.Exists(dllFile), $"{dllFile} exists at deployment."); - } - } - - public class TestFixture : DesktopApplicationTestFixture<SimpleApp.Startup> - { - public TestFixture() - { - PublishOnly = true; - } - - protected override DeploymentParameters GetDeploymentParameters() - { - var deploymentParameters = base.GetDeploymentParameters(); - deploymentParameters.AdditionalPublishParameters = "/p:PlatformTarget=AnyCPU"; - - return deploymentParameters; - } - } - } -}