Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Wasm.Build.Tests - use the new sdk with templates #85498

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
788 changes: 0 additions & 788 deletions eng/pipelines/common/platform-matrix.yml

Large diffs are not rendered by default.

182 changes: 91 additions & 91 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,51 +408,51 @@ extends:
#
# WebAssembly legs
#
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- browser_wasm
alwaysRun: ${{ variables.isRollingBuild }}
scenarios:
- normal
- WasmTestOnBrowser

- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- browser_wasm_win
alwaysRun: ${{ variables.isRollingBuild }}
scenarios:
- WasmTestOnBrowser

# EAT Library tests - only run on linux
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
parameters:
platforms:
- browser_wasm
nameSuffix: _EAT
runAOT: false
shouldRunSmokeOnly: false
alwaysRun: ${{ variables.isRollingBuild }}

# AOT Library tests
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
parameters:
platforms:
- browser_wasm
nameSuffix: _AOT
runAOT: true
shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }}

- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
parameters:
platforms:
- browser_wasm_win
nameSuffix: _AOT
runAOT: true
shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }}
#- template: /eng/pipelines/common/templates/wasm-library-tests.yml
#parameters:
#platforms:
#- browser_wasm
#alwaysRun: ${{ variables.isRollingBuild }}
#scenarios:
#- normal
#- WasmTestOnBrowser

#- template: /eng/pipelines/common/templates/wasm-library-tests.yml
#parameters:
#platforms:
#- browser_wasm_win
#alwaysRun: ${{ variables.isRollingBuild }}
#scenarios:
#- WasmTestOnBrowser

## EAT Library tests - only run on linux
#- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
#parameters:
#platforms:
#- browser_wasm
#nameSuffix: _EAT
#runAOT: false
#shouldRunSmokeOnly: false
#alwaysRun: ${{ variables.isRollingBuild }}

## AOT Library tests
#- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
#parameters:
#platforms:
#- browser_wasm
#nameSuffix: _AOT
#runAOT: true
#shouldRunSmokeOnly: true
#alwaysRun: ${{ variables.isRollingBuild }}

#- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
#parameters:
#platforms:
#- browser_wasm_win
#nameSuffix: _AOT
#runAOT: true
#shouldRunSmokeOnly: true
#alwaysRun: ${{ variables.isRollingBuild }}

# Wasm.Build.Tests
- template: /eng/pipelines/common/templates/wasm-build-tests.yml
Expand All @@ -463,61 +463,61 @@ extends:
alwaysRun: ${{ variables.isRollingBuild }}

# Wasm Debugger tests
- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml
parameters:
platforms:
- browser_wasm
- browser_wasm_win
alwaysRun: ${{ variables.isRollingBuild }}

# Wasm runtime tests
- template: /eng/pipelines/common/templates/wasm-runtime-tests.yml
parameters:
platforms:
- browser_wasm
alwaysRun: ${{ variables.isRollingBuild }}

# Build and Smoke Tests only - Wasm Threading Legs
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- browser_wasm
nameSuffix: _Threading_Smoke
extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:_WasmPThreadPoolSize=8
shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }}
scenarios:
- WasmTestOnBrowser

- template: /eng/pipelines/common/templates/wasm-build-only.yml
parameters:
platforms:
- browser_wasm
nameSuffix: _Threading_PerfTracing
extraBuildArgs: /p:MonoWasmBuildVariant=perftrace
alwaysRun: ${{ variables.isRollingBuild }}
#- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml
#parameters:
#platforms:
#- browser_wasm
#- browser_wasm_win
#alwaysRun: ${{ variables.isRollingBuild }}

## Wasm runtime tests
#- template: /eng/pipelines/common/templates/wasm-runtime-tests.yml
#parameters:
#platforms:
#- browser_wasm
#alwaysRun: ${{ variables.isRollingBuild }}

## Build and Smoke Tests only - Wasm Threading Legs
#- template: /eng/pipelines/common/templates/wasm-library-tests.yml
#parameters:
#platforms:
#- browser_wasm
#nameSuffix: _Threading_Smoke
#extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:_WasmPThreadPoolSize=8
#shouldRunSmokeOnly: true
#alwaysRun: ${{ variables.isRollingBuild }}
#scenarios:
#- WasmTestOnBrowser

#- template: /eng/pipelines/common/templates/wasm-build-only.yml
#parameters:
#platforms:
#- browser_wasm
#nameSuffix: _Threading_PerfTracing
#extraBuildArgs: /p:MonoWasmBuildVariant=perftrace
#alwaysRun: ${{ variables.isRollingBuild }}

# WASI/WASM

- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- wasi_wasm
- wasi_wasm_win
nameSuffix: '_Smoke'
extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true
shouldContinueOnError: true
shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }}
scenarios:
- normal
#- template: /eng/pipelines/common/templates/wasm-library-tests.yml
#parameters:
#platforms:
#- wasi_wasm
#- wasi_wasm_win
#nameSuffix: '_Smoke'
#extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true
#shouldContinueOnError: true
#shouldRunSmokeOnly: true
#alwaysRun: ${{ variables.isRollingBuild }}
#scenarios:
#- normal

- template: /eng/pipelines/common/templates/wasm-build-tests.yml
parameters:
platforms:
- wasi_wasm
- wasi_wasm_win
alwaysRun: ${{ variables.isRollingBuild }}
alwaysRun: true

#
# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size
Expand Down
3 changes: 2 additions & 1 deletion eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project TreatAsLocalProperty="ArchiveTests">
<PropertyGroup>
<_UseWasmSymbolicator Condition="'$(TestTrimming)' != 'true'">true</_UseWasmSymbolicator>
<WorkloadsTestPreviousVersions>true</WorkloadsTestPreviousVersions>
</PropertyGroup>

<Import Project="tests.wasm.targets" />
Expand Down Expand Up @@ -265,7 +266,7 @@
Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />

<WorkloadCombinationsToInstall Include="latest" Variants="latest" />
<WorkloadCombinationsToInstall Include="net7" Variants="net7" Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />
<!--<WorkloadCombinationsToInstall Include="net7" Variants="net7" Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />-->
<WorkloadCombinationsToInstall Include="net7+latest" Variants="net7;latest" Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" />
<!--<WorkloadCombinationsToInstall Include="net6" Variants="net6" />-->
<!--<WorkloadCombinationsToInstall Include="net6+7" Variants="net6;net7" />-->
Expand Down
7 changes: 7 additions & 0 deletions eng/testing/workloads-testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<Exec Condition="$([MSBuild]::IsOSPlatform('windows'))"
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallCommand)"' />

<ItemGroup>
<_WasmSdkProps Include="$(_SdkWithNoWorkloadPath)\sdk\**\Microsoft.NET.Sdk.WebAssembly\Sdk\Sdk.props" />
<_WasmSdkTargets Include="$(_SdkWithNoWorkloadPath)\sdk\**\Microsoft.NET.Sdk.WebAssembly\Sdk\Sdk.targets" />
</ItemGroup>
<Copy SourceFiles="$(RepoRoot)src\mono\wasm\Wasm.Build.Tests\WasmSdk.props" DestinationFiles="@(_WasmSdkProps)" />
<Copy SourceFiles="$(RepoRoot)src\mono\wasm\Wasm.Build.Tests\WasmSdk.targets" DestinationFiles="@(_WasmSdkTargets)" />

<!-- HACK: Remove the now invalid manifest `microsoft.net.workload.mono.toolchain` as a workaround
till the sdk removes it completely. -->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<ProjectReference Include="$(RepoTasksDir)Microsoft.NET.Sdk.WebAssembly.Pack.Tasks\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj" />
<PackageFile Include="build\*.props;build\*.targets;build\*.web.config" TargetPath="build" />
<PackageFile Include="Sdk\*.props;Sdk\*.targets;Sdk\*.web.config" TargetPath="Sdk" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't worked for me. How is it that it works now? Will it still work in blazor without workload?

</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ Copyright (c) .NET Foundation. All rights reserved.

</ItemGroup>

<PropertyGroup>
<_WasmLinkerEnabled>$(PublishTrimmed)</_WasmLinkerEnabled>
<_WasmLinkerEnabled Condition="'$(_WasmLinkerEnabled)' == ''">false</_WasmLinkerEnabled>
</PropertyGroup>

<ComputeStaticWebAssetsTargetPaths
Assets="@(_WasmJsModuleCandidatesForPublish);@(_BlazorExtensionsCandidatesForPublish)"
PathPrefix=""
Expand All @@ -504,7 +509,7 @@ Copyright (c) .NET Foundation. All rights reserved.
AssemblyPath="@(IntermediateAssembly)"
Resources="@(_WasmPublishBootResourceWithHash)"
DebugBuild="false"
LinkerEnabled="$(PublishTrimmed)"
LinkerEnabled="$(_WasmLinkerEnabled)"
CacheBootResources="$(BlazorCacheBootResources)"
OutputPath="$(IntermediateOutputPath)blazor.publish.boot.json"
ConfigurationFiles="@(_WasmPublishConfigFile)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Copyright (c) .NET Foundation. All rights reserved.
<_WebAssemblyPropsFile>$(MSBuildThisFileDirectory)\Microsoft.NET.Sdk.WebAssembly.Browser.props</_WebAssemblyPropsFile>
<_WebAssemblyTargetsFile>$(MSBuildThisFileDirectory)\Microsoft.NET.Sdk.WebAssembly.Browser.targets</_WebAssemblyTargetsFile>
</PropertyGroup>
<Import Project="$(_WebAssemblyPropsFile)" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0"></Project>
<Project ToolsVersion="14.0">
<Import Project="$(_WebAssemblyTargetsFile)" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"description": ".NET WebAssembly build tools",
"packs": [
"Microsoft.NET.Runtime.WebAssembly.Sdk",
"Microsoft.NET.Sdk.WebAssembly.Pack",
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm"
],
Expand Down Expand Up @@ -178,6 +179,10 @@
"kind": "Sdk",
"version": "${PackageVersion}"
},
"Microsoft.NET.Sdk.WebAssembly.Pack": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the consequence of this change? Will it still work in blazor without workload?

"kind": "Sdk",
"version": "${PackageVersion}"
},
"Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk": {
"kind": "Sdk",
"version": "${PackageVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Runtime.WebAssembly.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.WebAssembly.Sdk" />
<!--<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WebAssembly.Pack" />-->
<!--<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WebAssembly.Pack" />-->
<Import Project="Sdk.props" Sdk="Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Runtime.MonoTargets.Sdk" />
</ImportGroup>
Expand All @@ -149,6 +151,7 @@
<RuntimePackNamePatterns Condition="'$(RuntimeIdentifier)' == 'browser-wasm' and '$(WasmEnableThreads)' == 'true'">Microsoft.NETCore.App.Runtime.Mono.multithread.**RID**</RuntimePackNamePatterns>
<RuntimePackNamePatterns Condition="'$(RuntimeIdentifier)' == 'browser-wasm' and '$(WasmEnablePerfTracing)' == 'true'">Microsoft.NETCore.App.Runtime.Mono.perftrace.**RID**</RuntimePackNamePatterns>
</KnownRuntimePack>
<KnownWebAssemblySdkPack Remove="@(KnownWebAssemblySdkPack)" />
</ItemGroup>

<!-- we can't condition sdk imports on the item @(NativeFileReference). Instead, explicitly check before the build
Expand Down
12 changes: 10 additions & 2 deletions src/mono/wasm/Wasm.Build.Tests/BrowserRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ public async Task<IPage> RunAsync(ToolCommand cmd, string args, bool headless =
});

IPage page = await Browser.NewPageAsync();
if (onConsoleMessage is not null)
page.Console += (_, msg) => onConsoleMessage(msg);
page.Console += (_, msg) =>
{
if (onConsoleMessage is not null)
onConsoleMessage(msg);

// when not forwarding console messages, they show up as
// Console log messages here. That should be checked with
// the various regexes
outputHandler(msg.Text);
};
await page.GotoAsync(urlAvailable.Task.Result);
RunTask = runTask;
return page;
Expand Down
Loading