From 5966271e821d60f30cca9fd1bb10df6122d60290 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 10:22:42 +0000 Subject: [PATCH] Move Wasm.Build.Tests into a dedicated WasmBuildTests stage Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com> --- .../templates/browser-wasm-build-tests.yml | 20 +++++--- .../browser-wasm-coreclr-build-tests.yml | 16 ++++-- ...ntime-extra-platforms-wasm-build-tests.yml | 49 ++++++++++++++++++ .../runtime-extra-platforms-wasm.yml | 20 ++------ eng/pipelines/runtime-wasm-non-libtests.yml | 7 +++ eng/pipelines/runtime-wasm.yml | 6 +++ eng/pipelines/runtime.yml | 50 ++++++++++++------- 7 files changed, 122 insertions(+), 46 deletions(-) create mode 100644 eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml diff --git a/eng/pipelines/common/templates/browser-wasm-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-build-tests.yml index 39fca50137411f..ecde39b6b3e956 100644 --- a/eng/pipelines/common/templates/browser-wasm-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-build-tests.yml @@ -7,6 +7,11 @@ parameters: platforms: [] shouldContinueOnError: false extraBuildArgs: '' + # When true, these WBT jobs run in a dedicated 'WasmBuildTests' stage that + # depends on the 'Build' stage. In that case the cross-job 'dependsOn' on the + # build-only producer jobs must be dropped (job dependencies are stage-scoped); + # the producer artifacts are still fetched via DownloadBuildArtifacts@0. + separateStage: false jobs: @@ -40,13 +45,14 @@ jobs: value: $(shouldRunWasmBuildTestsOnDefaultPipeline) jobParameters: - dependsOn: - - ${{ if eq(platform, 'browser_wasm') }}: - - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly - - build_browser_wasm_linux_Release_SingleThreaded_BuildOnly - - ${{ if eq(platform, 'browser_wasm_win') }}: - - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly - - build_browser_wasm_windows_Release_SingleThreaded_BuildOnly + ${{ if ne(parameters.separateStage, true) }}: + dependsOn: + - ${{ if eq(platform, 'browser_wasm') }}: + - build_browser_wasm_linux_Release_MultiThreaded_BuildOnly + - build_browser_wasm_linux_Release_SingleThreaded_BuildOnly + - ${{ if eq(platform, 'browser_wasm_win') }}: + - build_browser_wasm_windows_Release_MultiThreaded_BuildOnly + - build_browser_wasm_windows_Release_SingleThreaded_BuildOnly isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop nameSuffix: WasmBuildTests diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index ac76b6332c3801..171afc1b1fa07f 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -7,6 +7,11 @@ parameters: platforms: [] shouldContinueOnError: false extraBuildArgs: '' + # When true, these WBT jobs run in a dedicated 'WasmBuildTests' stage that + # depends on the 'Build' stage. In that case the cross-job 'dependsOn' on the + # build-only producer jobs must be dropped (job dependencies are stage-scoped); + # the producer artifacts are still fetched via DownloadBuildArtifacts@0. + separateStage: false jobs: @@ -40,11 +45,12 @@ jobs: value: $(shouldRunWasmBuildTestsOnDefaultPipeline) jobParameters: - dependsOn: - - ${{ if eq(platform, 'browser_wasm') }}: - - build_browser_wasm_linux_Release_CoreCLR - - ${{ if eq(platform, 'browser_wasm_win') }}: - - build_browser_wasm_windows_Release_CoreCLR + ${{ if ne(parameters.separateStage, true) }}: + dependsOn: + - ${{ if eq(platform, 'browser_wasm') }}: + - build_browser_wasm_linux_Release_CoreCLR + - ${{ if eq(platform, 'browser_wasm_win') }}: + - build_browser_wasm_windows_Release_CoreCLR isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop nameSuffix: CoreCLR_WasmBuildTests diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml new file mode 100644 index 00000000000000..4d1633e4b9a091 --- /dev/null +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml @@ -0,0 +1,49 @@ +# Emits a dedicated 'WasmBuildTests' stage that runs Wasm.Build.Tests (WBT) for +# the extra-platforms wasm pipelines (runtime-wasm, runtime-wasm-non-libtests). +# +# The build-only producer jobs (wasm-build-only.yml) remain in the 'Build' stage +# emitted by runtime-extra-platforms-wasm.yml. This stage depends on 'Build', +# consumes the producers' published artifacts, and runs the WBT suite. It also +# depends on 'EvaluatePaths' (on PRs) because the WBT job conditions consume +# path-evaluation variables (shouldRunWasmBuildTestsOnDefaultPipeline, etc.). +# +# The stage is only emitted when WBT would actually run, mirroring the guard used +# for the WBT jobs in runtime-extra-platforms-wasm.yml, so pipelines that exclude +# WBT don't produce an empty stage. +parameters: + isExtraPlatformsBuild: false + isWasmOnlyBuild: false + isRollingBuild: false + excludeNonLibTests: false + debuggerTestsOnly: false + dependsOn: + - Build + +stages: +- ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeNonLibTests, true), ne(parameters.debuggerTestsOnly, true)) }}: + - stage: WasmBuildTests + displayName: Wasm.Build.Tests + dependsOn: + - ${{ each stage in parameters.dependsOn }}: + - ${{ stage }} + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - EvaluatePaths + jobs: + # Browser Wasm.Build.Tests (Mono) + - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml + parameters: + separateStage: true + platforms: + - browser_wasm + - browser_wasm_win + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + + # WASI Wasm.Build.Tests (single-threaded) + - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml + parameters: + platforms: + - wasi_wasm + - wasi_wasm_win + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 1fd298c4ecead8..37f7f553f94012 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -187,22 +187,10 @@ jobs: publishArtifactsForWorkload: true publishWBT: false - # Browser Wasm.Build.Tests - - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - - - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml - parameters: - platforms: - - wasi_wasm - - wasi_wasm_win - extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + # Note: Wasm.Build.Tests (browser + wasi) run in a dedicated 'WasmBuildTests' + # stage emitted by runtime-extra-platforms-wasm-build-tests.yml. The build-only + # producer jobs above stay in the 'Build' stage and publish artifacts the WBT + # stage consumes. - template: /eng/pipelines/common/templates/wasm-runtime-tests.yml parameters: diff --git a/eng/pipelines/runtime-wasm-non-libtests.yml b/eng/pipelines/runtime-wasm-non-libtests.yml index 2260d43277782a..cfe62680c9c92f 100644 --- a/eng/pipelines/runtime-wasm-non-libtests.yml +++ b/eng/pipelines/runtime-wasm-non-libtests.yml @@ -22,3 +22,10 @@ extends: isRollingBuild: ${{ variables.isRollingBuild }} excludeNonLibTests: false excludeLibTests: true + + - template: /eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml + parameters: + isExtraPlatformsBuild: ${{ variables.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ variables.isWasmOnlyBuild }} + isRollingBuild: ${{ variables.isRollingBuild }} + excludeNonLibTests: false diff --git a/eng/pipelines/runtime-wasm.yml b/eng/pipelines/runtime-wasm.yml index 44710d10d3aa57..66240c5598ecaf 100644 --- a/eng/pipelines/runtime-wasm.yml +++ b/eng/pipelines/runtime-wasm.yml @@ -25,3 +25,9 @@ extends: isWasmOnlyBuild: ${{ variables.isWasmOnlyBuild }} isRollingBuild: ${{ variables.isRollingBuild }} excludeOptional: false + + - template: /eng/pipelines/extra-platforms/runtime-extra-platforms-wasm-build-tests.yml + parameters: + isExtraPlatformsBuild: ${{ variables.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ variables.isWasmOnlyBuild }} + isRollingBuild: ${{ variables.isRollingBuild }} diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 5ca6b2e026f98a..96d963c6103f8b 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -259,15 +259,6 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true), eq(variables['isRollingBuild'], true)) - # Browser Wasm.Build.Tests - - template: /eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - alwaysRun: ${{ variables.isRollingBuild }} - extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - # # Build CoreCLR and Libraries with Libraries tests # For running libraries tests and installer tests @@ -1082,15 +1073,6 @@ extends: publishArtifactsForWorkload: true publishWBT: false - # Browser Wasm.Build.Tests - - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - alwaysRun: ${{ variables.isRollingBuild }} - extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - # Wasm runtime tests - template: /eng/pipelines/common/templates/wasm-runtime-tests.yml parameters: @@ -2003,3 +1985,35 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) + + # Dedicated stage for Wasm.Build.Tests (WBT). + # The producer runtime/build jobs remain in the 'Build' stage above; these + # WBT jobs depend on that stage, consume its published artifacts, and run the + # Wasm.Build.Tests suite. The stage also depends on 'EvaluatePaths' (on PRs) + # because the WBT job conditions consume path-evaluation variables. + - stage: WasmBuildTests + displayName: Wasm.Build.Tests + dependsOn: + - Build + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - EvaluatePaths + jobs: + # Browser Wasm.Build.Tests (CoreCLR) + - template: /eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml + parameters: + separateStage: true + platforms: + - browser_wasm + - browser_wasm_win + alwaysRun: ${{ variables.isRollingBuild }} + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + + # Browser Wasm.Build.Tests (Mono) + - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml + parameters: + separateStage: true + platforms: + - browser_wasm + - browser_wasm_win + alwaysRun: ${{ variables.isRollingBuild }} + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)