From e8005eb3959bfea49badeaced0b7ec2d2abe4d0e Mon Sep 17 00:00:00 2001 From: Jason Zhai Date: Wed, 10 Jul 2024 00:27:20 -0700 Subject: [PATCH 1/2] Fix test for Multi-Target Workloads --- test/Microsoft.NET.Build.Tests/WorkloadTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/WorkloadTests.cs b/test/Microsoft.NET.Build.Tests/WorkloadTests.cs index 579343059c58..ee27129ac38e 100644 --- a/test/Microsoft.NET.Build.Tests/WorkloadTests.cs +++ b/test/Microsoft.NET.Build.Tests/WorkloadTests.cs @@ -259,11 +259,11 @@ public void It_should_get_suggested_workload_by_GetRequiredWorkloads_target() .BeEquivalentTo("android"); } - [Theory(Skip = "https://github.com/dotnet/installer/issues/13361")] - [InlineData($"{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", $"{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", "android;android-aot")] - [InlineData(ToolsetInfo.CurrentTargetFramework, $"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", "macos;android-aot")] - [InlineData($"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-ios", $"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-android", "macos;android-aot")] - [InlineData(ToolsetInfo.CurrentTargetFramework, ToolsetInfo.CurrentTargetFramework, "macos")] + [Theory] + [InlineData($"{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", $"{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", "android;ios")] + [InlineData(ToolsetInfo.CurrentTargetFramework, $"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-android;{ToolsetInfo.CurrentTargetFramework}-ios", "android;ios")] + [InlineData($"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-ios", $"{ToolsetInfo.CurrentTargetFramework};{ToolsetInfo.CurrentTargetFramework}-android", "android;ios")] + [InlineData(ToolsetInfo.CurrentTargetFramework, ToolsetInfo.CurrentTargetFramework, null)] public void Given_multi_target_It_should_get_suggested_workload_by_GetRequiredWorkloads_target(string mainTfm, string referencingTfm, string expected) { // Skip Test if SDK is < 6.0.400 From 3b214333cc2917aae8e8d65dcd7de9f5e73eb33e Mon Sep 17 00:00:00 2001 From: Jason Zhai Date: Thu, 11 Jul 2024 19:54:23 -0700 Subject: [PATCH 2/2] Conditionally check the OS and modify the expected workloads on Linux --- test/Microsoft.NET.Build.Tests/WorkloadTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Microsoft.NET.Build.Tests/WorkloadTests.cs b/test/Microsoft.NET.Build.Tests/WorkloadTests.cs index ee27129ac38e..7526c08d0353 100644 --- a/test/Microsoft.NET.Build.Tests/WorkloadTests.cs +++ b/test/Microsoft.NET.Build.Tests/WorkloadTests.cs @@ -312,6 +312,12 @@ public void Given_multi_target_It_should_get_suggested_workload_by_GetRequiredWo } else { + // Conditionally check the OS and modify the expected workloads on Linux + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + expected = "android;wasi-experimental"; + } + getValuesCommand.GetValues() .Should() .Contain(expected.Split(";")); // there are extra workloads in certain platform, only assert contains