Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions test/EndToEnd.Tests/EndToEnd.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="MSTest.Sdk">
<PropertyGroup>
<OutDirName>Tests\$(MSBuildProjectName)</OutDirName>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
<!-- These tests rely on global process state, so run serially ([assembly: DoNotParallelize]). -->
<MSTestParallelizeScope></MSTestParallelizeScope>
</PropertyGroup>
Comment thread
Evangelink marked this conversation as resolved.

<ItemGroup>
<ProjectReference Include="..\Microsoft.NET.TestFramework\Microsoft.NET.TestFramework.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework.MSTest\Microsoft.NET.TestFramework.MSTest.csproj" />
<ProjectReference Include="..\..\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\Microsoft.NET.Sdk.WorkloadManifestReader.csproj" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<ItemGroup>
<Using Include="Microsoft.NET.TestFramework" />
<Using Include="Microsoft.NET.TestFramework.Assertions" />
<Using Include="Microsoft.NET.TestFramework.Commands" />
<Using Include="Microsoft.NET.TestFramework.Utilities" />
</ItemGroup>

</Project>
9 changes: 5 additions & 4 deletions test/EndToEnd.Tests/GivenDotNetLinuxInstallers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

namespace EndToEnd.Tests;

public class GivenDotNetLinuxInstallers(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenDotNetLinuxInstallers : SdkTest
{
private static readonly string[] ExcludedDebSuffixes = ["-newkey"];
private static readonly string[] ExcludedRpmSuffixes = ["-newkey", "-azl"];

[Fact]
[TestMethod]
public void ItHasExpectedDependencies()
{
var installerFile = Environment.GetEnvironmentVariable("SDK_INSTALLER_FILE");
Expand Down Expand Up @@ -77,7 +78,7 @@ private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string ins
.And.HaveStdOutMatching(@"dotnet-runtime-\d+(\.\d+){2} >= \d+(\.\d+){2}")
.And.HaveStdOutMatching(@"aspnetcore-store-\d+(\.\d+){2} >= \d+(\.\d+){2}");

[Fact]
[TestMethod]
public void DebPackagePreservesSymbolicLinks() =>
FileLinkHelpers.VerifyInstallerSymlinks(
OSPlatform.Linux,
Expand Down Expand Up @@ -106,7 +107,7 @@ private void ExtractDebPackage(string installerPath, string tempDir)
}
}

[Fact]
[TestMethod]
public void RpmPackagePreservesSymbolicLinks() =>
FileLinkHelpers.VerifyInstallerSymlinks(
OSPlatform.Linux,
Expand Down
5 changes: 3 additions & 2 deletions test/EndToEnd.Tests/GivenDotNetMacInstallers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

namespace EndToEnd.Tests;

public class GivenDotNetMacInstallers(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenDotNetMacInstallers : SdkTest
{
[Fact]
[TestMethod]
public void PkgPackagePreservesSymbolicLinks() =>
FileLinkHelpers.VerifyInstallerSymlinks(
OSPlatform.OSX,
Expand Down
16 changes: 10 additions & 6 deletions test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable

[assembly: CollectionBehavior(DisableTestParallelization = true)]
[assembly: DoNotParallelize]

namespace EndToEnd.Tests
{
public class GivenDotNetUsesMSBuild(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenDotNetUsesMSBuild : SdkTest
{
[RequiresMSBuildVersionFact("17.0.0.32901")]
[TestMethod]
[RequiresMSBuildVersion("17.0.0.32901")]
public void ItCanNewRestoreBuildRunCleanMSBuildProject()
{
string projectDirectory = TestAssetsManager.CreateTestDirectory().Path;
Expand Down Expand Up @@ -42,7 +44,8 @@ public void ItCanNewRestoreBuildRunCleanMSBuildProject()
}

// https://github.com/dotnet/sdk/issues/49665
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
[TestMethod]
[OSCondition(ConditionMode.Exclude, OperatingSystems.OSX)]
public void ItCanRunToolsInACSProj()
{
var testInstance = TestAssetsManager.CopyTestAsset("MSBuildTestApp")
Expand Down Expand Up @@ -76,7 +79,8 @@ public void ItCanRunToolsInACSProj()

// https://github.com/dotnet/sdk/issues/49665
// Failed to load /private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
[TestMethod]
[OSCondition(ConditionMode.Exclude, OperatingSystems.OSX)]
public void ItCanRunToolsThatPrefersTheCliRuntimeEvenWhenTheToolItselfDeclaresADifferentRuntime()
{
var testInstance = TestAssetsManager.CopyTestAsset("MSBuildTestApp")
Expand Down
7 changes: 4 additions & 3 deletions test/EndToEnd.Tests/GivenDotnetUsesDotnetTools.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace EndToEnd.Tests
{
public class GivenDotnetUsesDotnetTools(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenDotnetUsesDotnetTools : SdkTest
{
[Fact]
[TestMethod]
public void ThenOneDotnetToolsCanBeCalled()
{
new DotnetCommand(Log)
Expand Down
17 changes: 9 additions & 8 deletions test/EndToEnd.Tests/GivenFrameworkDependentApps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Expand All @@ -9,10 +9,11 @@

namespace EndToEnd.Tests
{
public class GivenFrameworkDependentApps(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenFrameworkDependentApps : SdkTest
{
[Theory]
[ClassData(typeof(SupportedNetCoreAppVersions))]
[TestMethod]
[DynamicData(nameof(SupportedNetCoreAppVersions.TestData), typeof(SupportedNetCoreAppVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfNetCore(string minorVersion)
{
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0" || minorVersion == "7.0" || minorVersion == "8.0" || minorVersion == "9.0" || minorVersion == "10.0" || minorVersion == "11.0")
Expand All @@ -23,8 +24,8 @@ public void ItDoesNotRollForwardToTheLatestVersionOfNetCore(string minorVersion)
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.NETCorePackageName, minorVersion);
}

[Theory]
[ClassData(typeof(SupportedAspNetCoreVersions))]
[TestMethod]
[DynamicData(nameof(SupportedAspNetCoreVersions.TestData), typeof(SupportedAspNetCoreVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreApp(string minorVersion)
{
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0" || minorVersion == "7.0" || minorVersion == "8.0" || minorVersion == "9.0" || minorVersion == "10.0" || minorVersion == "11.0")
Expand All @@ -35,8 +36,8 @@ public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreApp(string minorVe
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAppPackageName, minorVersion);
}

[Theory]
[ClassData(typeof(SupportedAspNetCoreAllVersions))]
[TestMethod]
[DynamicData(nameof(SupportedAspNetCoreAllVersions.TestData), typeof(SupportedAspNetCoreAllVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreAll(string minorVersion) => ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAllPackageName, minorVersion);

internal void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion)
Expand Down
8 changes: 5 additions & 3 deletions test/EndToEnd.Tests/GivenNetFrameworkSupportsNetStandard2.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace EndToEnd.Tests
{
public class GivenNetFrameworkSupportsNetStandard2(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenNetFrameworkSupportsNetStandard2 : SdkTest
{
[WindowsOnlyFact]
[TestMethod]
[OSCondition(OperatingSystems.Windows)]
public void Anet462ProjectCanReferenceANETStandardProject()
{
var _testInstance = TestAssetsManager
Expand Down
5 changes: 3 additions & 2 deletions test/EndToEnd.Tests/GivenSdkArchives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

namespace EndToEnd.Tests;

public class GivenSdkArchives(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenSdkArchives : SdkTest
{
[Fact]
[TestMethod]
public void ItHasDeduplicatedAssemblies()
{
// Find and extract archive
Expand Down
9 changes: 5 additions & 4 deletions test/EndToEnd.Tests/GivenSelfContainedAppsRollForward.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Expand All @@ -7,9 +7,10 @@

namespace EndToEnd.Tests
{
public partial class GivenSelfContainedAppsRollForward(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public partial class GivenSelfContainedAppsRollForward : SdkTest
{
[Fact]
[TestMethod]
public void WeCoverLatestNetCoreAppRollForward()
{
// Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions
Expand All @@ -35,7 +36,7 @@ public void WeCoverLatestNetCoreAppRollForward()
"of .NET Core created by \"dotnet new\"");
}

[Fact]
[TestMethod]
public void WeCoverLatestAspNetCoreAppRollForward()
{
var directory = TestAssetsManager.CreateTestDirectory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Expand All @@ -8,14 +8,15 @@

namespace EndToEnd.Tests
{
public partial class GivenUsingDefaultRuntimeFrameworkVersions(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public partial class GivenUsingDefaultRuntimeFrameworkVersions : SdkTest
{
private static readonly IEnumerable<string> frameworks = new string[] {"Microsoft.NETCore.App", "Microsoft.WindowsDesktop.App",
"Microsoft.WindowsDesktop.App.WPF", "Microsoft.WindowsDesktop.App.WindowsForms", "Microsoft.AspNetCore.App" };

private static readonly IEnumerable<string> versions = SupportedNetCoreAppVersions.Versions.Where(version => NuGetVersion.Parse(version).Major >= 3);

[Fact]
[TestMethod]
public void DefaultRuntimeVersionsAreUpToDate()
{
var outputFile = "resolvedVersions.txt";
Expand Down
12 changes: 8 additions & 4 deletions test/EndToEnd.Tests/GivenWeWantToRequireWindowsForDesktopApps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Expand All @@ -7,9 +7,12 @@

namespace EndToEnd.Tests
{
public class GivenWeWantToRequireWindowsForDesktopApps(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenWeWantToRequireWindowsForDesktopApps : SdkTest
{
[PlatformSpecificFact(TestPlatforms.Linux | TestPlatforms.OSX | TestPlatforms.FreeBSD, Skip = "https://github.com/dotnet/sdk/issues/42230")]
[TestMethod]
[OSCondition(ConditionMode.Exclude, OperatingSystems.Windows)]
[Ignore("https://github.com/dotnet/sdk/issues/42230")]
public void It_does_not_download_desktop_targeting_packs_on_unix()
{
var testProjectCreator = new TestProjectCreator()
Expand All @@ -29,7 +32,8 @@ public void It_does_not_download_desktop_targeting_packs_on_unix()
Directory.Exists(packagesPath).Should().BeFalse(packagesPath + " should not exist");
}

[PlatformSpecificFact(TestPlatforms.Linux | TestPlatforms.OSX | TestPlatforms.FreeBSD)]
[TestMethod]
[OSCondition(ConditionMode.Exclude, OperatingSystems.Windows)]
public void It_does_not_download_desktop_runtime_packs_on_unix()
{
const string Rid = "win-x64";
Expand Down
24 changes: 13 additions & 11 deletions test/EndToEnd.Tests/GivenWindowsApp.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Expand All @@ -7,18 +7,20 @@

namespace EndToEnd.Tests
{
public class GivenWindowsApp(ITestOutputHelper log) : SdkTest(log)
[TestClass]
public class GivenWindowsApp : SdkTest
{
[WindowsOnlyTheory]
[InlineData("10.0.17763.0")]
[InlineData("10.0.18362.0")]
[InlineData("10.0.19041.0")]
[InlineData("10.0.20348.0")]
[InlineData("10.0.22000.0")]
[InlineData("10.0.22621.0")]
[TestMethod]
[OSCondition(OperatingSystems.Windows)]
[DataRow("10.0.17763.0")]
[DataRow("10.0.18362.0")]
[DataRow("10.0.19041.0")]
[DataRow("10.0.20348.0")]
[DataRow("10.0.22000.0")]
[DataRow("10.0.22621.0")]
// Skipped due to: https://github.com/dotnet/sdk/pull/42090/files#r1680016439
//[InlineData("10.0.26100.0")]
[InlineData("10.0.22621.0", "34")]
//[DataRow("10.0.26100.0")]
[DataRow("10.0.22621.0", "34")]
public void ItCanBuildAndRun(string targetPlatformVersion, string packageVersion = "")
{
var testInstance = TestAssetsManager
Expand Down
Loading
Loading