diff --git a/eng/pipelines/common/templates/browser-wasm-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-build-tests.yml index 29a3f854724738..3bcbec8607cac0 100644 --- a/eng/pipelines/common/templates/browser-wasm-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-build-tests.yml @@ -110,6 +110,7 @@ jobs: /p:InstallWorkloadForTesting=true /p:WasmSkipMissingRuntimePackBuild=true /p:PreparePackagesForWorkloadInstall=false + /p:WorkloadsTestPreviousVersions=$(workloadsTestPreviousVersionsVar) timeoutInMinutes: 180 condition: >- or( diff --git a/eng/testing/workloads-browser.targets b/eng/testing/workloads-browser.targets index c5f6613059089e..f54d9a1d9de34e 100644 --- a/eng/testing/workloads-browser.targets +++ b/eng/testing/workloads-browser.targets @@ -17,7 +17,8 @@ + Version="$(PackageVersionForWorkloadManifests)" + Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" /> - + + diff --git a/eng/testing/workloads-wasi.targets b/eng/testing/workloads-wasi.targets index 356cad0fa06eff..5b9b4240228e9f 100644 --- a/eng/testing/workloads-wasi.targets +++ b/eng/testing/workloads-wasi.targets @@ -17,8 +17,11 @@ - + Version="$(PackageVersionForWorkloadManifests)" + Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" /> + + + diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index e3efcd584ce4f0..3608f1cae63d0d 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -156,6 +156,7 @@ + diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/EnvironmentVariables.cs b/src/mono/wasm/Wasm.Build.Tests/Common/EnvironmentVariables.cs index 7615d8adf5904d..e2cf9b3dbf8b43 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/EnvironmentVariables.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/EnvironmentVariables.cs @@ -24,5 +24,6 @@ internal static class EnvironmentVariables internal static readonly bool UseWebcil = Environment.GetEnvironmentVariable("USE_WEBCIL_FOR_TESTS") is "true"; internal static readonly string? SdkDirName = Environment.GetEnvironmentVariable("SDK_DIR_NAME"); internal static readonly string? WasiSdkPath = Environment.GetEnvironmentVariable("WASI_SDK_PATH"); + internal static readonly bool WorkloadsTestPreviousVersions = Environment.GetEnvironmentVariable("WORKLOADS_TEST_PREVIOUS_VERSIONS") is "true"; } } diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs index b1927711236c8c..ac20f6f784513e 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; @@ -452,13 +453,21 @@ public void ConsolePublishAndRun(string config, bool aot, bool relinking) Assert.Contains("args[2] = z", res.Output); } + public static IEnumerable BrowserBuildAndRunTestData() + { + yield return new object?[] { "", BuildTestBase.DefaultTargetFramework, DefaultRuntimeAssetsRelativePath }; + yield return new object?[] { "-f net9.0", "net9.0", DefaultRuntimeAssetsRelativePath }; + + if (EnvironmentVariables.WorkloadsTestPreviousVersions) + yield return new object?[] { "-f net8.0", "net8.0", DefaultRuntimeAssetsRelativePath }; + + // ActiveIssue("https://github.com/dotnet/runtime/issues/90979") + // yield return new object?[] { "", BuildTestBase.DefaultTargetFramework, "./" }; + // yield return new object?[] { "-f net8.0", "net8.0", "./" }; + } + [Theory] - [InlineData("", BuildTestBase.DefaultTargetFramework, DefaultRuntimeAssetsRelativePath)] - [InlineData("-f net9.0", "net9.0", DefaultRuntimeAssetsRelativePath)] - [InlineData("-f net8.0", "net8.0", DefaultRuntimeAssetsRelativePath)] - // [ActiveIssue("https://github.com/dotnet/runtime/issues/90979")] - // [InlineData("", BuildTestBase.DefaultTargetFramework, "./")] - // [InlineData("-f net8.0", "net8.0", "./")] + [MemberData(nameof(BrowserBuildAndRunTestData))] public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework, string runtimeAssetsRelativePath) { string config = "Debug";