From f55cd8118d4cb8965374b942c0af6062e7fd7deb Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Thu, 19 May 2022 15:25:38 +0000
Subject: [PATCH 01/11] [wasm] Improve path checks triggering wbt, and debugger
 tests

---
 eng/pipelines/common/evaluate-default-paths.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml
index 9d171b672427fe..6352a88f37f055 100644
--- a/eng/pipelines/common/evaluate-default-paths.yml
+++ b/eng/pipelines/common/evaluate-default-paths.yml
@@ -106,7 +106,8 @@ jobs:
     - subset: wasmbuildtests
       include:
       - src/tasks/*
-      - src/tests/BuildWasmApps/*
+      - src/tests/BuildWasmApps/Directory.Build*
+      - src/tests/BuildWasmApps/Wasm.Build.Tests/*
       - src/mono/wasm/build/*
       - src/mono/wasm/runtime/*
       - src/mono/wasm/templates/*
@@ -122,11 +123,13 @@ jobs:
       - eng/Version.Details.xml
       - eng/Versions.props
       - src/mono/wasm/emscripten-version.txt
+      - src/libraries/sendtohelix*
     - subset: wasmdebuggertests
       include:
       - src/mono/wasm/debugger/*
       - src/mono/wasm/runtime/*
-      - src/tests/BuildWasmApps/*
+      - src/tests/BuildWasmApps/Directory.Build*
+      - src/tests/BuildWasmApps/Wasm.Debugger.Tests/*
       - eng/testing/ProvisioningVersions.props
       - eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
       - src/mono/mono/*

From 4b3a6d83b7993d02e4b4bd063e6422ebf2fde528 Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Thu, 19 May 2022 15:26:41 +0000
Subject: [PATCH 02/11] [wasm] Add helix job to run tests with no workload
 installed.

This replaces the job that used `WasmApp.LocalBuild*` stuff to build
with a EMSDK checkout. That case already gets tested with library tests.

Since we have very few tests to run for the noworkloads case, they are
all run in a single helix work item.
---
 src/libraries/sendtohelix-wasm.targets        | 25 ++++++--
 src/libraries/sendtohelix.proj                |  4 +-
 .../BlazorWasmBuildPublishTests.cs            | 18 +++---
 .../Wasm.Build.Tests/BlazorWasmTests.cs       | 20 ++----
 .../Wasm.Build.Tests/BuildEnvironment.cs      | 38 ++---------
 .../Wasm.Build.Tests/BuildTestBase.cs         |  2 +-
 .../Wasm.Build.Tests/CleanTests.cs            |  6 +-
 .../Wasm.Build.Tests/EnvironmentVariables.cs  |  2 -
 .../Wasm.Build.Tests/LocalEMSDKTests.cs       | 64 -------------------
 .../Wasm.Build.Tests/NativeBuildTests.cs      |  2 +-
 .../Wasm.Build.Tests/NativeLibraryTests.cs    |  4 +-
 .../NoopNativeRebuildTest.cs                  |  4 +-
 .../PInvokeTableGeneratorTests.cs             |  6 +-
 .../Wasm.Build.Tests/Wasm.Build.Tests.csproj  | 10 +++
 .../Wasm.Build.Tests/WasmTemplateTests.cs     |  4 +-
 .../Wasm.Build.Tests/WorkloadTests.cs         |  2 +-
 .../data/Blazor.Local.Directory.Build.props   | 12 +---
 .../data/Local.Directory.Build.props          |  5 --
 .../data/Local.Directory.Build.targets        | 21 +-----
 .../data/RunScriptTemplate.cmd                |  2 +-
 .../data/RunScriptTemplate.sh                 |  5 +-
 21 files changed, 72 insertions(+), 184 deletions(-)
 delete mode 100644 src/tests/BuildWasmApps/Wasm.Build.Tests/LocalEMSDKTests.cs

diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets
index 3486b253e48c64..29cd15dd472f2e 100644
--- a/src/libraries/sendtohelix-wasm.targets
+++ b/src/libraries/sendtohelix-wasm.targets
@@ -23,7 +23,7 @@
     <DebuggerHost Condition="'$(DebuggerHost)' == ''">chrome</DebuggerHost>
 
     <NeedsWorkload Condition="'$(Scenario)' == 'BuildWasmApps'">true</NeedsWorkload>
-    <NeedsEMSDK Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true' or '$(Scenario)' == 'BuildWasmApps'">true</NeedsEMSDK>
+    <NeedsEMSDK Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true'">true</NeedsEMSDK>
     <NeedsEMSDKNode Condition="'$(Scenario)' == 'WasmTestOnNodeJs' or '$(Scenario)' == 'BuildWasmApps'">true</NeedsEMSDKNode>
     <NeedsToRunOnBrowser Condition="'$(Scenario)' == 'WasmTestOnBrowser' or '$(Scenario)' == 'BuildWasmApps'">true</NeedsToRunOnBrowser>
     <NeedsToRunOnBrowser Condition="'$(NeedsToRunOnBrowser)' == '' and '$(IsWasmDebuggerTests)' == 'true'">true</NeedsToRunOnBrowser>
@@ -83,6 +83,15 @@
     <HelixPreCommand Include="set PATH=$(_HelixLocalNodePath)/%_HELIX_NODEJS_VERSION%/bin%3B%PATH%" />
   </ItemGroup>
 
+  <PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
+    <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' == 'true'">-notrait category=no-workload</_XUnitTraitArg>
+    <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload</_XUnitTraitArg>
+  </PropertyGroup>
+  <ItemGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
+    <HelixPreCommand Condition="'$(WindowsShell)' == 'true'" Include="set &quot;XUnitTraitArg=$(_XUnitTraitArg)&quot;" />
+    <HelixPreCommand Condition="'$(WindowsShell)' != 'true'" Include="export &quot;XUnitTraitArg=$(_XUnitTraitArg)&quot;" />
+  </ItemGroup>
+
   <PropertyGroup>
 
     <!--
@@ -123,7 +132,8 @@
       <TestEchoMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))</TestEchoMiddleware>
       <RemoteLoopMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))</RemoteLoopMiddleware>
       <WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' == 'true'">Workloads-</WorkItemPrefix>
-      <WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' != 'true'">EMSDK-</WorkItemPrefix>
+      <WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' != 'true'">NoWorkload-</WorkItemPrefix>
+      <WorkItemPrefix Condition="'$(IsWasmDebuggerTests)' == 'true'">$(DebuggerHost)-</WorkItemPrefix>
       <WorkItemPrefix Condition="'$(WorkItemPrefix)' == '' and '$(Scenario)' != ''">$(Scenario)-</WorkItemPrefix>
     </PropertyGroup>
 
@@ -155,7 +165,7 @@
       <HelixCorrelationPayload Include="$(RemoteLoopMiddleware)" Destination="xharness/RemoteLoopMiddleware" Condition="Exists('$(RemoteLoopMiddleware)')" />
     </ItemGroup>
 
-    <ReadLinesFromFile File="$(BuildWasmAppsJobsList)" Condition="Exists($(BuildWasmAppsJobsList)) and '$(Scenario)' == 'BuildWasmApps'">
+    <ReadLinesFromFile File="$(BuildWasmAppsJobsList)" Condition="Exists($(BuildWasmAppsJobsList)) and '$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' == 'true'">
       <Output TaskParameter="Lines" ItemName="BuildWasmApps_PerJobList" />
     </ReadLinesFromFile>
 
@@ -191,14 +201,21 @@
       </HelixWorkItem>
     </ItemGroup>
 
+    <!-- for testing with workloads, we use separate items -->
     <ItemGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
-      <HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Extension)')">
+      <HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Extension)')" Condition="'$(TestUsingWorkloads)' == 'true'">
         <PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
         <PreCommands Condition="'$(OS)' == 'Windows_NT'">set &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
         <PreCommands Condition="'$(OS)' != 'Windows_NT'">export &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
         <Command>$(HelixCommand)</Command>
         <Timeout>$(_workItemTimeout)</Timeout>
       </HelixWorkItem>
+
+      <HelixWorkItem Include="NoWorkload-Wasm.Build.Tests" Condition="'$(TestUsingWorkloads)' != 'true'">
+        <PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
+        <Command>$(HelixCommand)</Command>
+        <Timeout>$(_workItemTimeout)</Timeout>
+      </HelixWorkItem>
     </ItemGroup>
 
     <ItemGroup Condition="'$(Scenario)' == 'WasmDebuggerTests'">
diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj
index ff512c1b1c0389..60de339e34023a 100644
--- a/src/libraries/sendtohelix.proj
+++ b/src/libraries/sendtohelix.proj
@@ -79,9 +79,7 @@
 
     <!-- For BuildWasmApps we want to build the project twice, with: TestUsingWorkloads=true, and TestUsingWorkloads=false -->
     <ItemGroup Condition="'@(_Scenarios -> AnyHaveMetadataValue('Identity', 'buildwasmapps'))' == 'true'">
-      <!-- TestUsingWorkloads=false - Disabled due to https://github.com/dotnet/arcade/issues/9025 -->
-      <!--<_TestUsingWorkloadsValues Include="true;false" />-->
-      <_TestUsingWorkloadsValues Include="true" />
+      <_TestUsingWorkloadsValues Include="true;false" />
 
       <_BuildWasmAppsProjectsToBuild Include="$(PerScenarioProjectFile)">
         <AdditionalProperties>$(_PropertiesToPass);Scenario=BuildWasmApps;TestArchiveRuntimeFile=$(TestArchiveRuntimeFile);TestUsingWorkloads=%(_TestUsingWorkloadsValues.Identity)</AdditionalProperties>
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs
index e550fa8bd8d9ea..60ae583f76d8b8 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs
@@ -21,7 +21,7 @@ public BlazorWasmBuildPublishTests(ITestOutputHelper output, SharedBuildPerTestC
             _enablePerTestCleanup = true;
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void DefaultTemplate_WithoutWorkload(string config)
@@ -38,7 +38,7 @@ public void DefaultTemplate_WithoutWorkload(string config)
             AssertBlazorBootJson(config, isPublish: true);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void DefaultTemplate_NoAOT_WithWorkload(string config)
@@ -58,7 +58,7 @@ public void DefaultTemplate_NoAOT_WithWorkload(string config)
             }
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void DefaultTemplate_AOT_InProjectFile(string config)
@@ -77,7 +77,7 @@ public void DefaultTemplate_AOT_InProjectFile(string config)
             BlazorBuild(new BlazorBuildOptions(id, config, NativeFilesType.FromRuntimePack));
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug", true)]
         [InlineData("Debug", false)]
         [InlineData("Release", true)]
@@ -121,7 +121,7 @@ public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRel
 
         // Disabling for now - publish folder can have more than one dotnet*hash*js, and not sure
         // how to pick which one to check, for the test
-        //[ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        //[Theory]
         //[InlineData("Debug")]
         //[InlineData("Release")]
         //public void DefaultTemplate_AOT_OnlyWithPublishCommandLine_Then_PublishNoAOT(string config)
@@ -140,7 +140,7 @@ public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRel
             //BlazorPublish(new BlazorBuildOptions(id, config, NativeFilesType.Relinked);
         //}
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void WithNativeReference_AOTInProjectFile(string config)
@@ -157,7 +157,7 @@ public void WithNativeReference_AOTInProjectFile(string config)
             BlazorBuild(new BlazorBuildOptions(id, config, NativeFilesType.Relinked));
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void WithNativeReference_AOTOnCommandLine(string config)
@@ -173,7 +173,7 @@ public void WithNativeReference_AOTOnCommandLine(string config)
             BlazorPublish(new BlazorBuildOptions(id, config, NativeFilesType.Relinked));
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void WithDllImportInMainAssembly(string config)
@@ -227,7 +227,7 @@ void CheckNativeFileLinked(bool forPublish)
             }
         }
 
-        [ConditionalFact(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Fact]
         public void BugRegression_60479_WithRazorClassLib()
         {
             string id = "blz_razor_lib_top";
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs
index 72419f66006e00..1641c7860d5b67 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs
@@ -16,19 +16,17 @@ public BlazorWasmTests(ITestOutputHelper output, SharedBuildPerTestClassFixture
         {
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
+        [Theory, TestCategory("no-workload")]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void NativeRef_EmitsWarningBecauseItRequiresWorkload(string config)
         {
             CommandResult res = PublishForRequiresWorkloadTest(config, extraItems: "<NativeFileReference Include=\"native-lib.o\" />");
             res.EnsureSuccessful();
-            AssertBlazorBundle(config, isPublish: true, dotnetWasmFromRuntimePack: true);
-
-            Assert.Contains("but the native references won't be linked in", res.Output);
+            Assert.Matches("warning : .*but the native references won't be linked in", res.Output);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
+        [Theory, TestCategory("no-workload")]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void AOT_FailsBecauseItRequiresWorkload(string config)
@@ -38,7 +36,7 @@ public void AOT_FailsBecauseItRequiresWorkload(string config)
             Assert.Contains("following workloads must be installed: wasm-tools", res.Output);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
+        [Theory, TestCategory("no-workload")]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void AOT_And_NativeRef_FailBecauseTheyRequireWorkload(string config)
@@ -56,13 +54,6 @@ private CommandResult PublishForRequiresWorkloadTest(string config, string extra
             string id = $"needs_workload_{config}_{Path.GetRandomFileName()}";
             CreateBlazorWasmTemplateProject(id);
 
-            if (IsNotUsingWorkloads)
-            {
-                // no packs installed, so no need to update the paths for runtime pack etc
-                File.Copy(Path.Combine(BuildEnvironment.TestDataPath, "Blazor.Local.Directory.Build.props"), Path.Combine(_projectDir!, "Directory.Build.props"), overwrite: true);
-                File.Copy(Path.Combine(BuildEnvironment.TestDataPath, "Blazor.Local.Directory.Build.targets"), Path.Combine(_projectDir!, "Directory.Build.targets"), overwrite: true);
-            }
-
             AddItemsPropertiesToProject(Path.Combine(_projectDir!, $"{id}.csproj"),
                                         extraProperties: extraProperties,
                                         extraItems: extraItems);
@@ -72,8 +63,7 @@ private CommandResult PublishForRequiresWorkloadTest(string config, string extra
                             .WithWorkingDirectory(_projectDir!)
                             .ExecuteWithCapturedOutput("publish",
                                                         $"-bl:{publishLogPath}",
-                                                        $"-p:Configuration={config}",
-                                                        "-p:MSBuildEnableWorkloadResolver=true"); // WasmApp.LocalBuild.* disables this, but it is needed for this test
+                                                        $"-p:Configuration={config}");
         }
 
         [Theory]
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs
index afbf3250e85ecb..2db7094b00951b 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs
@@ -27,8 +27,6 @@ public class BuildEnvironment
         public static readonly string           TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets");
         public static readonly string           TestDataPath = Path.Combine(AppContext.BaseDirectory, "data");
 
-        private static string s_runtimeConfig = "Release";
-
         public BuildEnvironment()
         {
             DirectoryInfo? solutionRoot = new (AppContext.BaseDirectory);
@@ -59,6 +57,7 @@ public BuildEnvironment()
             if (!Directory.Exists(sdkForWorkloadPath))
                 throw new Exception($"Could not find SDK_FOR_WORKLOAD_TESTING_PATH={sdkForWorkloadPath}");
 
+            EnvVars = new Dictionary<string, string>();
             bool workloadInstalled = EnvironmentVariables.SdkHasWorkloadInstalled != null && EnvironmentVariables.SdkHasWorkloadInstalled == "true";
             if (workloadInstalled)
             {
@@ -69,7 +68,6 @@ public BuildEnvironment()
                 RuntimePackDir = Path.Combine(sdkForWorkloadPath, "packs", "Microsoft.NETCore.App.Runtime.Mono.browser-wasm", workloadPacksVersion);
                 DirectoryBuildPropsContents = s_directoryBuildPropsForWorkloads;
                 DirectoryBuildTargetsContents = s_directoryBuildTargetsForWorkloads;
-                EnvVars = new Dictionary<string, string>();
 
                 var appRefDir = EnvironmentVariables.AppRefDir;
                 if (string.IsNullOrEmpty(appRefDir))
@@ -80,36 +78,12 @@ public BuildEnvironment()
             }
             else
             {
-                string emsdkPath;
-                if (solutionRoot == null)
-                {
-                    string? buildDir = EnvironmentVariables.WasmBuildSupportDir;
-                    if (buildDir == null || !Directory.Exists(buildDir))
-                        throw new Exception($"Could not find the solution root, or a build dir: {buildDir}");
-
-                    emsdkPath = Path.Combine(buildDir, "emsdk");
-                    RuntimePackDir = Path.Combine(buildDir, "microsoft.netcore.app.runtime.browser-wasm");
-                    DefaultBuildArgs = $" /p:WasmBuildSupportDir={buildDir} /p:EMSDK_PATH={emsdkPath} ";
-                }
-                else
-                {
-                    string artifactsBinDir = Path.Combine(solutionRoot.FullName, "artifacts", "bin");
-                    RuntimePackDir = Path.Combine(artifactsBinDir, "microsoft.netcore.app.runtime.browser-wasm", s_runtimeConfig);
-
-                    if (string.IsNullOrEmpty(EnvironmentVariables.EMSDK_PATH))
-                        emsdkPath = Path.Combine(solutionRoot.FullName, "src", "mono", "wasm", "emsdk");
-                    else
-                        emsdkPath = EnvironmentVariables.EMSDK_PATH;
-
-                    DefaultBuildArgs = $" /p:RuntimeSrcDir={solutionRoot.FullName} /p:RuntimeConfig={s_runtimeConfig} /p:EMSDK_PATH={emsdkPath} ";
-                }
-
-                IsWorkload = false;
-                EnvVars = new Dictionary<string, string>()
-                {
-                    ["EMSDK_PATH"] = emsdkPath
-                };
+                RuntimePackDir = "/dont-check-runtime-pack-dir-for-no-workloads-case";
+                var appRefDir = EnvironmentVariables.AppRefDir;
+                if (string.IsNullOrEmpty(appRefDir))
+                    throw new Exception($"Cannot test with workloads without AppRefDir environment variable being set");
 
+                DefaultBuildArgs = $" /p:AppRefDir={appRefDir}";
                 DirectoryBuildPropsContents = s_directoryBuildPropsForLocal;
                 DirectoryBuildTargetsContents = s_directoryBuildTargetsForLocal;
             }
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
index ddcc00f84eb5f3..0d2b33954c1cfe 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
@@ -71,7 +71,7 @@ static BuildTestBase()
 
                 Console.WriteLine ("");
                 Console.WriteLine ($"==============================================================================================");
-                Console.WriteLine ($"=============== Running with {(s_buildEnv.IsWorkload ? "Workloads" : "EMSDK")} ===============");
+                Console.WriteLine ($"=============== Running with {(s_buildEnv.IsWorkload ? "Workloads" : "No workloads")} ===============");
                 Console.WriteLine ($"==============================================================================================");
                 Console.WriteLine ("");
             }
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/CleanTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/CleanTests.cs
index e9551724ec8efc..6a8ca8ce204d01 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/CleanTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/CleanTests.cs
@@ -20,7 +20,7 @@ public CleanTests(ITestOutputHelper output, SharedBuildPerTestClassFixture build
     {
     }
 
-    [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+    [Theory]
     [InlineData("Debug")]
     [InlineData("Release")]
     public void Blazor_BuildThenClean_NativeRelinking(string config)
@@ -48,13 +48,13 @@ public void Blazor_BuildThenClean_NativeRelinking(string config)
         AssertEmptyOrNonExistantDirectory(relinkDir);
     }
 
-    [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+    [Theory]
     [InlineData("Debug")]
     [InlineData("Release")]
     public void Blazor_BuildNoNative_ThenBuildNative_ThenClean(string config)
         => Blazor_BuildNativeNonNative_ThenCleanTest(config, firstBuildNative: false);
 
-    [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+    [Theory]
     [InlineData("Debug")]
     [InlineData("Release")]
     public void Blazor_BuildNative_ThenBuildNonNative_ThenClean(string config)
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/EnvironmentVariables.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/EnvironmentVariables.cs
index 506aafe44b7f39..a2439797566848 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/EnvironmentVariables.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/EnvironmentVariables.cs
@@ -13,8 +13,6 @@ internal static class EnvironmentVariables
         internal static readonly string? SdkHasWorkloadInstalled   = Environment.GetEnvironmentVariable("SDK_HAS_WORKLOAD_INSTALLED");
         internal static readonly string? WorkloadPacksVersion      = Environment.GetEnvironmentVariable("WORKLOAD_PACKS_VER");
         internal static readonly string? AppRefDir                 = Environment.GetEnvironmentVariable("AppRefDir");
-        internal static readonly string? WasmBuildSupportDir       = Environment.GetEnvironmentVariable("WasmBuildSupportDir");
-        internal static readonly string? EMSDK_PATH                = Environment.GetEnvironmentVariable("EMSDK_PATH");
         internal static readonly string? TestLogPath               = Environment.GetEnvironmentVariable("TEST_LOG_PATH");
         internal static readonly string? SkipProjectCleanup        = Environment.GetEnvironmentVariable("SKIP_PROJECT_CLEANUP");
         internal static readonly string? XHarnessCliPath           = Environment.GetEnvironmentVariable("XHARNESS_CLI_PATH");
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/LocalEMSDKTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/LocalEMSDKTests.cs
deleted file mode 100644
index 5a85ae935bb916..00000000000000
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/LocalEMSDKTests.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-using System.IO;
-using Xunit;
-using Xunit.Abstractions;
-
-#nullable enable
-
-namespace Wasm.Build.Tests
-{
-    public class LocalEMSDKTests : BuildTestBase
-    {
-        public LocalEMSDKTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) : base(output, buildContext)
-        {}
-
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
-        [BuildAndRun(aot: true, host: RunHost.None, parameters: new object[]
-                        { "", "error :.*emscripten.*required for AOT" })]
-        [BuildAndRun(aot: true, host: RunHost.None, parameters: new object[]
-                        { "/non-existant/foo", "error.*\\(EMSDK_PATH\\)=/non-existant/foo.*required for AOT" })]
-        public void AOT_ErrorWhenMissingEMSDK(BuildArgs buildArgs, string emsdkPath, string errorPattern, string id)
-        {
-            string projectName = $"missing_emsdk";
-            buildArgs = buildArgs with {
-                            ProjectName = projectName,
-                            ExtraBuildArgs = $"/p:EMSDK_PATH={emsdkPath}"
-            };
-            buildArgs = ExpandBuildArgs(buildArgs);
-
-            (_, string buildOutput) = BuildProject(buildArgs,
-                        id: id,
-                        new BuildProjectOptions(
-                            InitProject: () => File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), s_mainReturns42),
-                            ExpectSuccess: false));
-
-            Assert.Matches(errorPattern, buildOutput);
-        }
-
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsNotUsingWorkloads))]
-        [BuildAndRun(host: RunHost.None, parameters: new object[]
-                        { "", "error.*emscripten.*required for building native files" })]
-        [BuildAndRun(host: RunHost.None, parameters: new object[]
-                        { "/non-existant/foo", "error.*\\(EMSDK_PATH\\)=/non-existant/foo.*required for building native files" })]
-        public void Relinking_ErrorWhenMissingEMSDK(BuildArgs buildArgs, string emsdkPath, string errorPattern, string id)
-        {
-            string projectName = $"simple_native_build";
-            buildArgs = buildArgs with {
-                            ProjectName = projectName,
-                            ExtraBuildArgs = $"/p:EMSDK_PATH={emsdkPath}"
-            };
-            buildArgs = ExpandBuildArgs(buildArgs, extraProperties: "<WasmBuildNative>true</WasmBuildNative>");
-
-            (_, string buildOutput) = BuildProject(buildArgs,
-                        id: id,
-                        new BuildProjectOptions(
-                            InitProject: () => File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), s_mainReturns42),
-                            ExpectSuccess: false));
-
-            Assert.Matches(errorPattern, buildOutput);
-        }
-    }
- }
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeBuildTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeBuildTests.cs
index 5107a7d52b7130..17d140f9a562f7 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeBuildTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeBuildTests.cs
@@ -101,7 +101,7 @@ public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(BuildArgs buildArgs, st
                                             + " It might fail if it was incorrectly compiled to a bitcode file, instead of wasm.");
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void BlazorWasm_CanRunMonoAOTCross_WithNoTrimming(string config)
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeLibraryTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeLibraryTests.cs
index e8892a9575d017..c659ce90739e83 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeLibraryTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeLibraryTests.cs
@@ -17,7 +17,7 @@ public NativeLibraryTests(ITestOutputHelper output, SharedBuildPerTestClassFixtu
         {
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [BuildAndRun(aot: false)]
         [BuildAndRun(aot: true)]
         public void ProjectWithNativeReference(BuildArgs buildArgs, RunHost host, string id)
@@ -48,7 +48,7 @@ public void ProjectWithNativeReference(BuildArgs buildArgs, RunHost host, string
             Assert.Contains("from pinvoke: 142", output);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [BuildAndRun(aot: false)]
         [BuildAndRun(aot: true)]
         public void ProjectUsingSkiaSharp(BuildArgs buildArgs, RunHost host, string id)
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs
index 1b9d9f01bde2f6..1cc525391ad77b 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs
@@ -35,7 +35,7 @@ public void NoOpRebuildForNativeBuilds(BuildArgs buildArgs, bool nativeRelink, b
             RunAndTestWasmApp(buildArgs, buildDir: _projectDir, expectedExitCode: 42, host: host, id: id);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void BlazorNoopRebuild(string config)
@@ -62,7 +62,7 @@ public void BlazorNoopRebuild(string config)
         }
 
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void BlazorOnlyLinkRebuild(string config)
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs
index feada6bed9b99c..133ec47c710554 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs
@@ -17,7 +17,7 @@ public PInvokeTableGeneratorTests(ITestOutputHelper output, SharedBuildPerTestCl
         {
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [BuildAndRun(host: RunHost.V8)]
         public void NativeLibraryWithVariadicFunctions(BuildArgs buildArgs, RunHost host, string id)
         {
@@ -54,7 +54,7 @@ public static int Main(string[] args)
             Assert.Contains("Main running", output);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [BuildAndRun(host: RunHost.V8)]
         public void DllImportWithFunctionPointersCompilesWithWarning(BuildArgs buildArgs, RunHost host, string id)
         {
@@ -86,7 +86,7 @@ public static int Main()
             Assert.Contains("Main running", output);
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [BuildAndRun(host: RunHost.V8)]
         public void DllImportWithFunctionPointers_ForVariadicFunction_CompilesWithWarning(BuildArgs buildArgs, RunHost host, string id)
         {
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
index c8e810f68be384..9a0ecdf0192d3a 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
@@ -43,10 +43,17 @@
       <RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set BASE_DIR=%HELIX_CORRELATION_PAYLOAD%" />
     </ItemGroup>
 
+    <PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
+      <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' == 'true'">-notrait category=no-workload</_XUnitTraitArg>
+      <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload</_XUnitTraitArg>
+    </PropertyGroup>
     <ItemGroup Condition="'$(ContinuousIntegrationBuild)' != 'true'">
       <RunScriptCommands Condition="'$(OS)' != 'Windows_NT'" Include="export TEST_USING_WORKLOADS=$(TestUsingWorkloads)" />
       <RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set TEST_USING_WORKLOADS=$(TestUsingWorkloads)" />
 
+      <RunScriptCommands Condition="'$(OS)' != 'Windows_NT'" Include="export &quot;XUnitTraitArg=$(_XUnitTraitArg)&quot;" />
+      <RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set &quot;XUnitTraitArg=$(_XUnitTraitArg)&quot;" />
+
       <RunScriptCommands Condition="'$(OS)' != 'Windows_NT'" Include="export BASE_DIR=$(ArtifactsBinDir)" />
       <RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set BASE_DIR=$(ArtifactsBinDir)" />
     </ItemGroup>
@@ -72,6 +79,9 @@
 
       <!-- this allows use of test attributes from dotnet.xunitextensions -->
       <RunScriptCommand>$(RunScriptCommand) -notrait category=IgnoreForCI -notrait category=failing</RunScriptCommand>
+
+      <RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">$(RunScriptCommand) %XUnitTraitArg%</RunScriptCommand>
+      <RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$(RunScriptCommand) %24XUnitTraitArg</RunScriptCommand>
     </PropertyGroup>
   </Target>
 </Project>
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmTemplateTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmTemplateTests.cs
index 0624a488667f97..649e38394c5da8 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmTemplateTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmTemplateTests.cs
@@ -19,7 +19,7 @@ public WasmTemplateTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur
         {
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void BrowserBuildThenPublish(string config)
@@ -62,7 +62,7 @@ public void BrowserBuildThenPublish(string config)
                             UseCache: false));
         }
 
-        [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Theory]
         [InlineData("Debug")]
         [InlineData("Release")]
         public void ConsoleBuildThenPublish(string config)
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/WorkloadTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/WorkloadTests.cs
index ae67ab1cb4b9a8..55df68a8987b9b 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/WorkloadTests.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/WorkloadTests.cs
@@ -22,7 +22,7 @@ public WorkloadTests(ITestOutputHelper output, SharedBuildPerTestClassFixture bu
         {
         }
 
-        [ConditionalFact(typeof(BuildTestBase), nameof(IsUsingWorkloads))]
+        [Fact]
         [SkipOnPlatform(TestPlatforms.Windows, "Not applicable on windows")]
         public void FilesInUnixFilesPermissionsXmlExist()
         {
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Local.Directory.Build.props b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Local.Directory.Build.props
index 909ea0382ba0ef..058246e4086204 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Local.Directory.Build.props
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Local.Directory.Build.props
@@ -1,11 +1 @@
-<Project>
-  <PropertyGroup Condition="'$(RuntimeSrcDir)' != '' and '$(WasmBuildSupportDir)' == ''">
-    <ArtifactsBinDir>$(RuntimeSrcDir)\artifacts\bin\</ArtifactsBinDir>
-    <MicrosoftNetCoreAppRuntimePackLocationToUse>$([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.browser-wasm', $(RuntimeConfig)))</MicrosoftNetCoreAppRuntimePackLocationToUse>
-  </PropertyGroup>
-
-  <PropertyGroup Condition="'$(RuntimeSrcDir)' == '' and '$(WasmBuildSupportDir)' != ''">
-    <BuildBaseDir>$(WasmBuildSupportDir)\</BuildBaseDir>
-    <MicrosoftNetCoreAppRuntimePackLocationToUse>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'microsoft.netcore.app.runtime.browser-wasm'))</MicrosoftNetCoreAppRuntimePackLocationToUse>
-  </PropertyGroup>
-</Project>
+<Project />
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.props b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.props
index 6d53e53b3bf551..216bb0ea3f6a24 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.props
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.props
@@ -1,10 +1,5 @@
 <Project>
   <PropertyGroup>
-    <_WasmTargetsDir Condition="'$(RuntimeSrcDir)' != ''">$(RuntimeSrcDir)\src\mono\wasm\build\</_WasmTargetsDir>
-    <_WasmTargetsDir Condition="'$(WasmBuildSupportDir)' != ''">$(WasmBuildSupportDir)\wasm\</_WasmTargetsDir>
-    <EMSDK_PATH Condition="'$(WasmBuildSupportDir)' != ''">$(WasmBuildSupportDir)\emsdk\</EMSDK_PATH>
     <PublishTrimmed>true</PublishTrimmed>
   </PropertyGroup>
-
-  <Import Project="$(_WasmTargetsDir)WasmApp.LocalBuild.props" Condition="Exists('$(_WasmTargetsDir)WasmApp.LocalBuild.props')" />
 </Project>
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets
index 2bc257a74862f7..51d7fe87e19760 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets
@@ -1,28 +1,9 @@
 <Project>
   <ItemGroup>
-      <EmscriptenEnvVars Include="FROZEN_CACHE=" Condition="'$(OS)' == 'Windows_NT'" />
+    <EmscriptenEnvVars Include="FROZEN_CACHE=" Condition="'$(OS)' == 'Windows_NT'" />
   </ItemGroup>
 
-  <Target Name="CheckWasmLocalBuildInputs" BeforeTargets="Build">
-    <Error Condition="'$(RuntimeSrcDir)' == '' and '$(WasmBuildSupportDir)' == ''"
-           Text="Both %24(RuntimeSrcDir) and %24(WasmBuildSupportDir) are not set. Either one of them needs to be set to use local runtime builds" />
-
-    <Error Condition="'$(RuntimeSrcDir)' != '' and '$(WasmBuildSupportDir)' != ''"
-           Text="Both %24(RuntimeSrcDir) and %24(WasmBuildSupportDir) are set. " />
-
-    <Error Condition="!Exists('$(_WasmTargetsDir)WasmApp.LocalBuild.props')"
-           Text="Could not find WasmApp.LocalBuild.props in $(_WasmTargetsDir)" />
-    <Error Condition="!Exists('$(_WasmTargetsDir)WasmApp.LocalBuild.targets')"
-           Text="Could not find WasmApp.LocalBuild.targets in $(_WasmTargetsDir)" />
-
-    <Warning
-      Condition="'$(WasmMainJS)' != '' and '$(WasmGenerateAppBundle)' != 'true'"
-      Text="%24(WasmMainJS) is set when %24(WasmGenerateAppBundle) is not true: it won't be used because an app bundle is not being generated. Possible build authoring error" />
-  </Target>
-
   <Target Name="PrintRuntimePackPath" BeforeTargets="Build">
     <Message Text="** MicrosoftNetCoreAppRuntimePackDir : %(ResolvedRuntimePack.PackageDirectory)" Importance="High" />
   </Target>
-
-  <Import Project="$(_WasmTargetsDir)WasmApp.LocalBuild.targets" Condition="Exists('$(_WasmTargetsDir)WasmApp.LocalBuild.targets')" />
 </Project>
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.cmd b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.cmd
index 56c194e21e8a1c..bca245bc43785a 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.cmd
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.cmd
@@ -102,6 +102,6 @@ if [%TEST_USING_WORKLOADS%] == [true] (
     set "PATH=%BASE_DIR%\sdk-no-workload;%PATH%"
     set SDK_HAS_WORKLOAD_INSTALLED=false
     set "SDK_FOR_WORKLOAD_TESTING_PATH=%BASE_DIR%\sdk-no-workload"
-    set "WasmBuildSupportDir=%BASE_DIR%\build"
+    set "AppRefDir=%BASE_DIR%\microsoft.netcore.app.ref"
 )
 EXIT /b 0
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh
index 95a4b8200930c6..1130c803f271eb 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh
@@ -71,12 +71,11 @@ function set_env_vars()
         export SDK_HAS_WORKLOAD_INSTALLED=true
         export SDK_FOR_WORKLOAD_TESTING_PATH=$BASE_DIR/dotnet-workload
         export AppRefDir=$BASE_DIR/microsoft.netcore.app.ref
-    elif [[ -n "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then
-        export WasmBuildSupportDir=$BASE_DIR/build
     else
         export PATH=$BASE_DIR/sdk-no-workload:$PATH
         export SDK_HAS_WORKLOAD_INSTALLED=false
         export SDK_FOR_WORKLOAD_TESTING_PATH=$BASE_DIR/sdk-no-workload
+        export AppRefDir=$BASE_DIR/microsoft.netcore.app.ref
     fi
 }
 
@@ -100,4 +99,4 @@ echo ----- end $(date) ----- exit code $_exitCode ------------------------------
 
 echo "XHarness artifacts: $XHARNESS_OUT"
 
-exit $_exitCode
\ No newline at end of file
+exit $_exitCode

From b04c1190a12479c8b6252f049d9d36bd86df033e Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Thu, 19 May 2022 16:42:12 +0000
Subject: [PATCH 03/11] [wasm][debugger] Run all the debugger tests in a single
 helix job

---
 src/libraries/sendtohelix-wasm.targets       | 12 +-----------
 src/mono/wasm/debugger/Directory.Build.props |  6 +++---
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets
index 29cd15dd472f2e..168d97a6afc2be 100644
--- a/src/libraries/sendtohelix-wasm.targets
+++ b/src/libraries/sendtohelix-wasm.targets
@@ -14,7 +14,6 @@
     <EnableDefaultBuildHelixWorkItems Condition="'$(IsRunningLibraryTests)' != 'true'">false</EnableDefaultBuildHelixWorkItems>
 
     <BuildWasmAppsJobsList>$(RepositoryEngineeringDir)\testing\scenarios\BuildWasmAppsJobsList.txt</BuildWasmAppsJobsList>
-    <WasmDebuggerTestsJobsList>$(RepositoryEngineeringDir)\testing\scenarios\WasmDebuggerTestsJobsList.txt</WasmDebuggerTestsJobsList>
 
     <!-- on unix CI has emscripten provisioned in $(EMSDK_PATH) as `/usr/local/emscripten`. -->
     <EMSDK_PATH Condition="$([MSBuild]::IsOSPlatform('WINDOWS')) and '$(EMSDK_PATH)' == ''">$(RepoRoot)src\mono\wasm\emsdk\</EMSDK_PATH>
@@ -169,10 +168,6 @@
       <Output TaskParameter="Lines" ItemName="BuildWasmApps_PerJobList" />
     </ReadLinesFromFile>
 
-    <ReadLinesFromFile File="$(WasmDebuggerTestsJobsList)" Condition="Exists($(WasmDebuggerTestsJobsList)) and '$(Scenario)' == 'WasmDebuggerTests'">
-      <Output TaskParameter="Lines" ItemName="WasmDebuggerTests_PerJobList" />
-    </ReadLinesFromFile>
-
     <!-- library tests get added as default work items -->
     <ItemGroup Condition="'$(IsRunningLibraryTests)' != 'true'">
       <!-- for buildwasmapps, the archive path is set in src/libraries/Directory.Build.props, so use that -->
@@ -219,13 +214,8 @@
     </ItemGroup>
 
     <ItemGroup Condition="'$(Scenario)' == 'WasmDebuggerTests'">
-      <HelixWorkItem Include="@(WasmDebuggerTests_PerJobList -> '$(DebuggerHost)-%(Identity)')">
+      <HelixWorkItem Include="$(DebuggerHost)-DebuggerTests">
         <PayloadArchive>$(_WasmDebuggerTestsPayloadArchive)</PayloadArchive>
-
-        <!-- FIXME: workaround for https://github.com/dotnet/runtime/issues/62660 -->
-        <PreCommands Condition="'$(OS)' == 'Windows_NT'">set TEST_ARGS=--filter &quot;FullyQualifiedName~%(Identity)&amp;Category^!=windows-failing&amp;Category^!=failing&quot;</PreCommands>
-        <PreCommands Condition="'$(OS)' != 'Windows_NT'">export TEST_ARGS=&quot;--filter FullyQualifiedName~%(Identity)&amp;Category!=linux-failing&amp;Category!=failing&quot;</PreCommands>
-
         <Command>$(HelixCommand)</Command>
         <Timeout>$(_workItemTimeout)</Timeout>
       </HelixWorkItem>
diff --git a/src/mono/wasm/debugger/Directory.Build.props b/src/mono/wasm/debugger/Directory.Build.props
index c9cccf897a6b98..262662e3a62125 100644
--- a/src/mono/wasm/debugger/Directory.Build.props
+++ b/src/mono/wasm/debugger/Directory.Build.props
@@ -1,6 +1,6 @@
 <Project>
-    <PropertyGroup>
-        <RuntimeConfiguration Condition="'$(RuntimeConfiguration)' == ''">Release</RuntimeConfiguration>
-    </PropertyGroup>
+  <PropertyGroup>
+    <RuntimeConfiguration Condition="'$(RuntimeConfiguration)' == ''">Release</RuntimeConfiguration>
+  </PropertyGroup>
   <Import Project="..\..\Directory.Build.props" />
 </Project>

From ea96dfdc381b9e849b0b9578192c13ac38861ee6 Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Thu, 19 May 2022 18:51:42 +0000
Subject: [PATCH 04/11] [wasm] Wasm.Build.Tests: always show progress

---
 src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs       | 2 --
 .../BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj      | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
index 0d2b33954c1cfe..722d5246cc9c60 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
@@ -85,7 +85,6 @@ static BuildTestBase()
         public BuildTestBase(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
         {
             _testIdx = Interlocked.Increment(ref s_testCounter);
-            Console.WriteLine($"-------- New test #{_testIdx} --------");
             _buildContext = buildContext;
             _testOutput = output;
             _logPath = s_buildEnv.LogRootPath; // FIXME:
@@ -833,7 +832,6 @@ public static string AddItemsPropertiesToProject(string projectFile, string? ext
 
         public void Dispose()
         {
-            Console.WriteLine($"-------- test done #{_testIdx} --------");
             if (_projectDir != null && _enablePerTestCleanup)
                 _buildContext.RemoveFromCache(_projectDir, keepDir: s_skipProjectCleanup);
         }
diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
index 9a0ecdf0192d3a..c28e51dd56f6fd 100644
--- a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
+++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
@@ -71,8 +71,8 @@
       <RunScriptCommand Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT'">$(RunScriptCommand) %HELIX_XUNIT_ARGS%</RunScriptCommand>
 
       <RunScriptCommand Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(RunScriptCommand) -nocolor</RunScriptCommand>
-      <RunScriptCommand Condition="'$(ContinuousIntegrationBuild)' == 'true' or '$(XUnitShowProgress)' == 'true'">$(RunScriptCommand) -verbose</RunScriptCommand>
       <RunScriptCommand Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT'">$(RunScriptCommand) -parallel none</RunScriptCommand>
+      <RunScriptCommand>$(RunScriptCommand) -verbose</RunScriptCommand>
 
       <RunScriptCommand Condition="'$(XUnitMethodName)' != ''">$(RunScriptCommand) -method $(XUnitMethodName)</RunScriptCommand>
       <RunScriptCommand Condition="'$(XUnitClassName)' != ''">$(RunScriptCommand) -class $(XUnitClassName)</RunScriptCommand>

From e918d8bb4b98dc522409fbfe7b3e86a80b9c11ea Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:00:58 +0000
Subject: [PATCH 05/11] Remove now unused WasmDebuggerTestsJobsList.txt

---
 .../common/evaluate-default-paths.yml         |  1 -
 .../scenarios/WasmDebuggerTestsJobsList.txt   | 20 -------------------
 2 files changed, 21 deletions(-)
 delete mode 100644 eng/testing/scenarios/WasmDebuggerTestsJobsList.txt

diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml
index 6352a88f37f055..9eaf4c45e0a30a 100644
--- a/eng/pipelines/common/evaluate-default-paths.yml
+++ b/eng/pipelines/common/evaluate-default-paths.yml
@@ -131,7 +131,6 @@ jobs:
       - src/tests/BuildWasmApps/Directory.Build*
       - src/tests/BuildWasmApps/Wasm.Debugger.Tests/*
       - eng/testing/ProvisioningVersions.props
-      - eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
       - src/mono/mono/*
     - subset: allwasm
       include:
diff --git a/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt b/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
deleted file mode 100644
index c4e1405de7d354..00000000000000
--- a/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-DebuggerTests.ArrayTests
-DebuggerTests.AssignmentTests
-DebuggerTests.AsyncTests
-DebuggerTests.BadHarnessInitTests
-DebuggerTests.BreakpointTests
-DebuggerTests.CallFunctionOnTests
-DebuggerTests.CustomViewTests
-DebuggerTests.DateTimeTests
-DebuggerTests.DelegateTests
-DebuggerTests.EvaluateOnCallFrameTests
-DebuggerTests.ExceptionTests
-DebuggerTests.GetPropertiesTests
-DebuggerTests.HarnessTests
-DebuggerTests.HotReloadTests
-DebuggerTests.MonoJsTests
-DebuggerTests.PointerTests
-DebuggerTests.SetVariableValueTests
-DebuggerTests.MiscTests
-DebuggerTests.SteppingTests
-DebuggerTests.SetNextIpTests

From 22f73b268268756b39e929b3dad43e35c6483b6c Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:09:26 +0000
Subject: [PATCH 06/11] wasm: don't fail the job for firefox debugger test
 failures

---
 eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 ++
 eng/pipelines/runtime-extra-platforms-wasm.yml         | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml
index 2c52fcfc612fa0..34a99bec41c7fb 100644
--- a/eng/pipelines/common/templates/wasm-debugger-tests.yml
+++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml
@@ -3,6 +3,7 @@ parameters:
   isExtraPlatformsBuild: false
   browser: 'chrome'
   platforms: []
+  shouldContinueOnError: false
 
 jobs:
 
@@ -41,3 +42,4 @@ jobs:
         extraHelixArguments: /p:BrowserHost=$(_hostedOs) /p:_DebuggerHosts=${{ parameters.browser }}
         scenarios:
         - wasmdebuggertests
+        shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
diff --git a/eng/pipelines/runtime-extra-platforms-wasm.yml b/eng/pipelines/runtime-extra-platforms-wasm.yml
index a8f345ee363ff2..6ef6b3ce5420d6 100644
--- a/eng/pipelines/runtime-extra-platforms-wasm.yml
+++ b/eng/pipelines/runtime-extra-platforms-wasm.yml
@@ -124,3 +124,5 @@ jobs:
         - Browser_wasm_firefox
       browser: firefox
       alwaysRun: ${{ parameters.isWasmOnlyBuild }}
+      # don't fail because firefox tests are known to be unstable right now
+      shouldContinueOnError: true

From f19cab24315cad4fd6fb0b7311b1577e90833825 Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:12:52 +0000
Subject: [PATCH 07/11] do the same for runtime-staging firefox too

---
 eng/pipelines/runtime-staging.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml
index 6f66971d3694ad..5479b4ba299415 100644
--- a/eng/pipelines/runtime-staging.yml
+++ b/eng/pipelines/runtime-staging.yml
@@ -98,6 +98,7 @@ jobs:
       - Browser_wasm_firefox
     browser: firefox
     alwaysRun: ${{ variables.isRollingBuild }}
+    shouldContinueOnError: true
 
 #
 # Build the whole product using Mono and run libraries tests

From f9a67184c05b67eb1a0224bf2c56685ac878285a Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:23:26 +0000
Subject: [PATCH 08/11] fix

---
 eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml
index 34a99bec41c7fb..d9b75dfaa059a2 100644
--- a/eng/pipelines/common/templates/wasm-debugger-tests.yml
+++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml
@@ -29,6 +29,7 @@ jobs:
       nameSuffix: Mono_DebuggerTests_${{ parameters.browser }}
       buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }}
       timeoutInMinutes: 180
+      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
       condition: >-
         or(
           eq(variables['alwaysRunVar'], true),
@@ -42,4 +43,3 @@ jobs:
         extraHelixArguments: /p:BrowserHost=$(_hostedOs) /p:_DebuggerHosts=${{ parameters.browser }}
         scenarios:
         - wasmdebuggertests
-        shouldContinueOnError: ${{ parameters.shouldContinueOnError }}

From 1aba8e78c6098c090b42ba5f8f98b4baad6dce03 Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:28:56 +0000
Subject: [PATCH 09/11] Revert "fix"

This reverts commit f9a67184c05b67eb1a0224bf2c56685ac878285a.
---
 eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml
index d9b75dfaa059a2..34a99bec41c7fb 100644
--- a/eng/pipelines/common/templates/wasm-debugger-tests.yml
+++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml
@@ -29,7 +29,6 @@ jobs:
       nameSuffix: Mono_DebuggerTests_${{ parameters.browser }}
       buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) /p:DebuggerHost=${{ parameters.browser }}
       timeoutInMinutes: 180
-      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
       condition: >-
         or(
           eq(variables['alwaysRunVar'], true),
@@ -43,3 +42,4 @@ jobs:
         extraHelixArguments: /p:BrowserHost=$(_hostedOs) /p:_DebuggerHosts=${{ parameters.browser }}
         scenarios:
         - wasmdebuggertests
+        shouldContinueOnError: ${{ parameters.shouldContinueOnError }}

From af3dcf82d0522d827787beeec6cc9fe977c25dbd Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:28:59 +0000
Subject: [PATCH 10/11] Revert "do the same for runtime-staging firefox too"

This reverts commit f19cab24315cad4fd6fb0b7311b1577e90833825.
---
 eng/pipelines/runtime-staging.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml
index 5479b4ba299415..6f66971d3694ad 100644
--- a/eng/pipelines/runtime-staging.yml
+++ b/eng/pipelines/runtime-staging.yml
@@ -98,7 +98,6 @@ jobs:
       - Browser_wasm_firefox
     browser: firefox
     alwaysRun: ${{ variables.isRollingBuild }}
-    shouldContinueOnError: true
 
 #
 # Build the whole product using Mono and run libraries tests

From 97f3916524f1e85224e1ccff7c874bf65bb04199 Mon Sep 17 00:00:00 2001
From: Ankit Jain <radical@gmail.com>
Date: Fri, 20 May 2022 17:29:01 +0000
Subject: [PATCH 11/11] Revert "wasm: don't fail the job for firefox debugger
 test failures"

This reverts commit 22f73b268268756b39e929b3dad43e35c6483b6c.
---
 eng/pipelines/common/templates/wasm-debugger-tests.yml | 2 --
 eng/pipelines/runtime-extra-platforms-wasm.yml         | 2 --
 2 files changed, 4 deletions(-)

diff --git a/eng/pipelines/common/templates/wasm-debugger-tests.yml b/eng/pipelines/common/templates/wasm-debugger-tests.yml
index 34a99bec41c7fb..2c52fcfc612fa0 100644
--- a/eng/pipelines/common/templates/wasm-debugger-tests.yml
+++ b/eng/pipelines/common/templates/wasm-debugger-tests.yml
@@ -3,7 +3,6 @@ parameters:
   isExtraPlatformsBuild: false
   browser: 'chrome'
   platforms: []
-  shouldContinueOnError: false
 
 jobs:
 
@@ -42,4 +41,3 @@ jobs:
         extraHelixArguments: /p:BrowserHost=$(_hostedOs) /p:_DebuggerHosts=${{ parameters.browser }}
         scenarios:
         - wasmdebuggertests
-        shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
diff --git a/eng/pipelines/runtime-extra-platforms-wasm.yml b/eng/pipelines/runtime-extra-platforms-wasm.yml
index 6ef6b3ce5420d6..a8f345ee363ff2 100644
--- a/eng/pipelines/runtime-extra-platforms-wasm.yml
+++ b/eng/pipelines/runtime-extra-platforms-wasm.yml
@@ -124,5 +124,3 @@ jobs:
         - Browser_wasm_firefox
       browser: firefox
       alwaysRun: ${{ parameters.isWasmOnlyBuild }}
-      # don't fail because firefox tests are known to be unstable right now
-      shouldContinueOnError: true
