Removed unnecessary flaky tests

This commit is contained in:
Ajay Bhargav Baaskaran 2018-03-29 16:36:50 -07:00
parent 29f25cefe9
commit 83ebebcabc
8 changed files with 0 additions and 437 deletions

View File

@ -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;
}
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -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();
}
}
}

View File

@ -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.");
}
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -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.");
}
}
}
}

View File

@ -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;
}
}
}
}