Merge branch 'main' into merge/release/6.0.3xx-to-main

This commit is contained in:
Marc Paine 2022-03-28 14:04:09 -07:00 committed by GitHub
commit d4a55a8b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
98 changed files with 1761 additions and 1203 deletions

View file

@ -18,7 +18,7 @@ namespace EndToEnd
[ClassData(typeof(SupportedNetCoreAppVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfNetCore(string minorVersion)
{
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0")
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0" || minorVersion == "7.0")
{
// https://github.com/dotnet/core-sdk/issues/621
return;
@ -30,7 +30,7 @@ namespace EndToEnd
[ClassData(typeof(SupportedAspNetCoreVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreApp(string minorVersion)
{
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0")
if (minorVersion == "3.0" || minorVersion == "3.1" || minorVersion == "5.0" || minorVersion == "6.0" || minorVersion == "7.0")
{
// https://github.com/dotnet/core-sdk/issues/621
return;

View file

@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
{
var testProjectCreator = new TestProjectCreator()
{
MinorVersion = "6.0"
MinorVersion = "7.0"
};
testProjectCreator.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\packages";

View file

@ -15,6 +15,8 @@ namespace EndToEnd.Tests
{
public class ProjectBuildTests : TestBase
{
private static readonly string currentTfm = "net7.0";
[Fact]
public void ItCanNewRestoreBuildRunCleanMSBuildProject()
{
@ -27,6 +29,13 @@ namespace EndToEnd.Tests
.Execute(newArgs)
.Should().Pass();
string projectPath = Path.Combine(projectDirectory, directory.Name + ".csproj");
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework").Value = currentTfm;
project.Save(projectPath);
new RestoreCommand()
.WithWorkingDirectory(projectDirectory)
.Execute()
@ -71,6 +80,8 @@ namespace EndToEnd.Tests
var ns = project.Root.Name.Namespace;
project.Root.Attribute("Sdk").Value = "Microsoft.NET.Sdk.Web";
project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework").Value = currentTfm;
project.Save(projectPath);
@ -85,13 +96,20 @@ namespace EndToEnd.Tests
.Should().Pass().And.HaveStdOutContaining("Hello, World!");
}
[WindowsOnlyFact]
public void ItCanPublishArm64Winforms()
[WindowsOnlyTheory]
[InlineData("net5.0")]
[InlineData("current")]
public void ItCanPublishArm64Winforms(string TargetFramework)
{
DirectoryInfo directory = TestAssets.CreateTestDirectory();
string projectDirectory = directory.FullName;
string TargetFrameworkParameter = "";
string newArgs = "winforms --no-restore";
if (TargetFramework != "current")
{
TargetFrameworkParameter = $"-f {TargetFramework}";
}
string newArgs = $"winforms {TargetFrameworkParameter} --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute(newArgs)
@ -111,13 +129,21 @@ namespace EndToEnd.Tests
selfContainedPublishDir.Should().HaveFilesMatching($"{directory.Name}.dll", SearchOption.TopDirectoryOnly);
}
[WindowsOnlyFact]
public void ItCanPublishArm64Wpf()
[WindowsOnlyTheory]
[InlineData("net5.0")]
[InlineData("current")]
public void ItCanPublishArm64Wpf(string TargetFramework)
{
DirectoryInfo directory = TestAssets.CreateTestDirectory();
string projectDirectory = directory.FullName;
string TargetFrameworkParameter = "";
string newArgs = "wpf --no-restore";
if (TargetFramework != "current")
{
TargetFrameworkParameter = $"-f {TargetFramework}";
}
string newArgs = $"wpf {TargetFrameworkParameter} --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute(newArgs)
@ -288,7 +314,7 @@ namespace EndToEnd.Tests
[InlineData("razorclasslib")]
public void ItCanCreateAndBuildTemplatesWithDefaultFramework(string templateName, string language = "")
{
string framework = DetectExpectedDefaultFramework();
string framework = DetectExpectedDefaultFramework(templateName);
TestTemplateCreateAndBuild(templateName, selfContained: true, language: language, framework: framework);
}
@ -335,7 +361,7 @@ namespace EndToEnd.Tests
[InlineData("winformscontrollib", "VB")]
public void ItCanCreateAndBuildTemplatesWithDefaultFramework_Windows(string templateName, string language = "")
{
string framework = DetectExpectedDefaultFramework();
string framework = DetectExpectedDefaultFramework(templateName);
TestTemplateCreateAndBuild(templateName, selfContained: true, language: language, framework: $"{framework}-windows");
}
@ -360,16 +386,17 @@ namespace EndToEnd.Tests
}
}
private static string DetectExpectedDefaultFramework()
private static string DetectExpectedDefaultFramework(string template = "")
{
string dotnetFolder = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);
string[] runtimeFolders = Directory.GetDirectories(Path.Combine(dotnetFolder, "shared", "Microsoft.NETCore.App"));
int latestMajorVersion = runtimeFolders.Select(folder => int.Parse(Path.GetFileName(folder).Split('.').First())).Max();
if (latestMajorVersion == 6)
if (latestMajorVersion == 7)
{
return "net6.0";
return $"net{latestMajorVersion}.0";
}
throw new Exception("Unsupported version of SDK");
}

View file

@ -29,7 +29,8 @@ namespace EndToEnd
"3.0",
"3.1",
"5.0",
"6.0"
"6.0",
"7.0"
};
public static IEnumerable<string> TargetFrameworkShortFolderVersion

View file

@ -143,7 +143,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
RemoveCliGeneratedEnvironmentVariablesFrom(psi);
psi.Environment["DOTNET_MULTILEVEL_LOOKUP"] = "0";
psi.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = "1";
// Set DOTNET_ROOT to ensure sub process find the same host fxr
string dotnetDirectoryPath = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);

View file

@ -7,5 +7,6 @@
<PackageReference Include="FluentAssertions" Version="4.18.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="$(MicrosoftDotNetCliUtilsPackageVersion)" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>
</Project>

View file

@ -46,10 +46,6 @@
</ItemGroup>
<Target Name="GetRuntimesToInstall">
<PropertyGroup>
<Supports1xRuntimes>true</Supports1xRuntimes>
</PropertyGroup>
<ReadLinesFromFile File="/etc/os-release"
Condition="'$(OS)' != 'Windows_NT'">
<Output TaskParameter="Lines" PropertyName="OsReleaseContents"/>
@ -60,41 +56,13 @@
<OsReleaseContents>Windows</OsReleaseContents>
</PropertyGroup>
<PropertyGroup Condition="$(OsReleaseContents.Contains('NAME=%22Ubuntu%22'))">
<Supports1xRuntimes Condition="$(OsReleaseContents.Contains('VERSION_ID=%2218.04%22'))">false</Supports1xRuntimes>
</PropertyGroup>
<PropertyGroup Condition="$(OsReleaseContents.Contains('NAME=Fedora'))">
<Supports1xRuntimes>false</Supports1xRuntimes>
</PropertyGroup>
<PropertyGroup Condition="$(OsReleaseContents.Contains('NAME=%22Debian'))">
<Supports1xRuntimes>false</Supports1xRuntimes>
</PropertyGroup>
<PropertyGroup Condition="$(OsReleaseContents.Contains('NAME=%22openSUSE%20Leap%22'))">
<Supports1xRuntimes>false</Supports1xRuntimes>
</PropertyGroup>
<PropertyGroup Condition="$(OsReleaseContents.Contains('NAME=%22Alpine%20Linux%22'))">
<Supports1xRuntimes>false</Supports1xRuntimes>
</PropertyGroup>
<!-- RHEL 6 does not appear to have the os-release file -->
<PropertyGroup Condition="'$(OsReleaseContents)' == ''">
<Supports1xRuntimes>false</Supports1xRuntimes>
</PropertyGroup>
<ItemGroup Condition="'$(Supports1xRuntimes)' == 'true'">
<RuntimeVersionToInstall Include="1.0.5" />
<RuntimeVersionToInstall Include="1.1.2" />
</ItemGroup>
<ItemGroup>
<RuntimeVersionToInstall Include="2.1.0" />
<RuntimeVersionToInstall Include="2.2.5" />
<RuntimeVersionToInstall Include="3.0.0" />
<RuntimeVersionToInstall Include="3.1.0" />
<RuntimeVersionToInstall Include="5.0.0" />
<RuntimeVersionToInstall Include="6.0.0" />
</ItemGroup>
</Target>
@ -213,14 +181,15 @@
<ToolRunPrefix>$(ToolRunPrefix)unset DOTNET_INSTALLDIR &amp;&amp; </ToolRunPrefix>
</PropertyGroup>
<Exec Command="$(ToolRunPrefix)dotnet new tool-manifest"
<Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet new tool-manifest"
WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/>
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"
IgnoreStandardErrorWarningFormat="true" />
<PropertyGroup>
<SdkTestPackageVersion>$(MicrosoftNETSdkPackageVersion)</SdkTestPackageVersion>
<InstallToolCommand>dotnet tool install --local $(ToolCommandName)</InstallToolCommand>
<InstallToolCommand>$(RedistLayoutPath)dotnet tool install --local $(ToolCommandName)</InstallToolCommand>
<InstallToolCommand>$(InstallToolCommand) --version $(SdkTestPackageVersion)</InstallToolCommand>
</PropertyGroup>
@ -258,7 +227,7 @@
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipPortableLinux.xml"</TestArgs>
</PropertyGroup>
<Exec Command="$(ToolRunPrefix)dotnet tool run $(ToolCommandName) -- $(TestArgs)"
<Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet tool run $(ToolCommandName) -- $(TestArgs)"
WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/>
</Target>

View file

@ -145,174 +145,5 @@
Skip="true"
Issue=""
Reason="https://github.com/dotnet/installer/pull/8966#issuecomment-721111308"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_keeps_symbols_by_default"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_links_simple_app_without_analysis_warnings_and_it_runs"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_does_not_include_leftover_artifacts_on_second_run"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_runs_and_creates_linked_app"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_respects_warning_level_independently"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_runs_incrementally"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_symbols_option_can_override_defaults_from_debugger_support"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_removes_symbols_when_debugger_support_is_disabled"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_displays_informational_warning"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.PrepareForILLink_can_set_IsTrimmable"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_accepts_option_to_remove_symbols"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_defaults_keep_nonframework"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_accepts_root_descriptor"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_respects_global_TrimMode"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_only_runs_when_switch_is_enabled"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_error_on_nonboolean_optimization_flag"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishASingleFileApp.It_generates_a_single_file_including_pdbs"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.PrepareForILLink_can_set_TrimMode"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_accepts_option_to_enable_analysis_warnings"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_error_on_portable_app"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_can_treat_warnings_not_as_errors"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.TrimmingOptions_are_defaulted_correctly_on_trimmed_apps"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_errors_fail_the_build"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_can_treat_warnings_as_errors"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_roots_IntermediateAssembly"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_can_treat_warnings_as_errors_independently"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_accepts_option_to_disable_analysis_warnings"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_can_ignore_warnings"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_respects_analysis_level"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_accepts_option_to_enable_analysis_warnings_without_PublishTrimmed"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_ignores_host_config_settings_with_link_false"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_respects_feature_settings_from_host_config"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishAWebApp.It_publishes_as_framework_dependent_by_default"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishASingleFileApp.It_errors_when_enabling_compression_targeting_net5"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToRunILLink.ILLink_analysis_warnings_are_disabled_by_default"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.AppHostTests.It_builds_a_runnable_apphost_by_default"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.GivenThatWeWantToBuildADesktopExeWithFSharp.It_builds_a_simple_net50_app"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Publish.Tests.GivenThatWeWantToPublishASingleFileApp.It_can_include_ni_pdbs_in_single_file"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.GivenWeWantToRequireWindowsForDesktopApps.It_builds_on_windows_with_the_windows_desktop_sdk_5_0_with_ProjectSdk_set"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.GivenWeWantToRequireWindowsForDesktopApps.When_TargetPlatformVersion_is_set_higher_than_10_It_can_reference_cswinrt_api"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.GivenWeWantToRequireWindowsForDesktopApps.Given_duplicated_ResolvedFileToPublish_It_Can_Publish"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
<Method Name="Microsoft.NET.Build.Tests.GivenWeWantToRequireWindowsForDesktopApps.It_builds_on_windows_with_the_windows_desktop_sdk_5_0_without_ProjectSdk_set"
Skip="true"
Issue=""
Reason="Cannot run with non-existent LastRuntimeFrameworkVersion"/>
</SkippedTests>
</Tests>