Skip to content

Commit 591f6f7

Browse files
authored
[browser] Use WebAssembly SDK for runtime tests (#120330)
1 parent 8957509 commit 591f6f7

File tree

84 files changed

+468
-1034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+468
-1034
lines changed

eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ jobs:
2626
platforms:
2727
- browser_wasm
2828
- browser_wasm_win
29-
nameSuffix: _AOT
29+
nameSuffix: _Smoke_AOT
3030
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
3131
runAOT: true
32+
buildAOTOnHelix: false
33+
shouldRunSmokeOnly: true
3234
alwaysRun: true
3335

3436
# AOT Library tests - wasi_wasm
@@ -99,6 +101,7 @@ jobs:
99101
nameSuffix: _EAT
100102
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /maxcpucount:1
101103
runAOT: false
104+
buildAOTOnHelix: false
102105
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
103106
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
104107

@@ -108,9 +111,11 @@ jobs:
108111
platforms:
109112
- browser_wasm
110113
- browser_wasm_win
111-
nameSuffix: _AOT
114+
nameSuffix: _Smoke_AOT
112115
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
113116
runAOT: true
117+
buildAOTOnHelix: false
118+
shouldRunSmokeOnly: true
114119
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
115120
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
116121
alwaysRun: ${{ parameters.isWasmOnlyBuild }}

eng/pipelines/runtime.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ extends:
854854
platforms:
855855
- browser_wasm
856856
nameSuffix: _EAT
857+
buildAOTOnHelix: false
857858
runAOT: false
858859
shouldRunSmokeOnly: false
859860
alwaysRun: ${{ variables.isRollingBuild }}
@@ -867,6 +868,7 @@ extends:
867868
- browser_wasm_win
868869
nameSuffix: _Smoke_AOT
869870
runAOT: true
871+
buildAOTOnHelix: false
870872
shouldRunSmokeOnly: true
871873
alwaysRun: ${{ variables.isRollingBuild }}
872874
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)

eng/testing/linker/SupportFiles/Directory.Build.targets

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />
44

55
<PropertyGroup>
6-
<BundleDir>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'AppBundle'))</BundleDir>
6+
<BundleDir>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'publish', 'wwwroot'))</BundleDir>
77
<WasmMainAssemblyFileName>project.dll</WasmMainAssemblyFileName>
8+
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
89
</PropertyGroup>
910

1011
<Target Name="CreateTestWasmAppBundle"
1112
AfterTargets="Publish"
12-
DependsOnTargets="BundleTestWasmApp"
13+
DependsOnTargets="PrepareForWasmBuildApp;_WasmGenerateRunV8Script;BundleTestWasmApp"
1314
Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'" />
1415

1516
<PropertyGroup Condition="'$(PublishAot)' == 'true'">

eng/testing/linker/project.csproj.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<WasmAppBuilderTasksAssemblyPath>{WasmAppBuilderTasksAssemblyPath}</WasmAppBuilderTasksAssemblyPath>
4242
<MonoTargetsTasksAssemblyPath>{MonoTargetsTasksAssemblyPath}</MonoTargetsTasksAssemblyPath>
4343
<MicrosoftNetCoreAppRuntimePackRidDir>{MicrosoftNetCoreAppRuntimePackRidDir}</MicrosoftNetCoreAppRuntimePackRidDir>
44+
<_WebAssemblyPropsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.props</_WebAssemblyPropsFile>
45+
<_WebAssemblyTargetsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.targets</_WebAssemblyTargetsFile>
46+
<_WebAssemblySdkToolsDirectory>{WasmSdkPackTasksPath}</_WebAssemblySdkToolsDirectory>
47+
<UsingBrowserRuntimeWorkload>true</UsingBrowserRuntimeWorkload>
4448

4549
<!-- Needed for targetingpacks.targets -->
4650
<ProductVersion>{ProductVersion}</ProductVersion>

eng/testing/linker/trimmingTests.targets

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
<TestConsoleAppSourceFiles>
3131
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
3232
<TestCommand Condition="'$(TargetArchitecture)' != 'wasm' or '$(TargetOS)' != 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'project'))</TestCommand>
33-
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.sh'))</TestCommand>
33+
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot', 'run-v8.sh'))</TestCommand>
3434
<TestExecutionDirectory Condition="'$(TargetArchitecture)' != 'wasm' or '$(TargetOS)' != 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish'))</TestExecutionDirectory>
35-
<TestExecutionDirectory Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle'))</TestExecutionDirectory>
35+
<TestExecutionDirectory Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot'))</TestExecutionDirectory>
3636
</TestConsoleAppSourceFiles>
3737
</ItemGroup>
3838

@@ -114,6 +114,8 @@
114114
.Replace('{MonoTargetsTasksAssemblyPath}', '$(MonoTargetsTasksAssemblyPath)')
115115
.Replace('{WasmAppBuilderTasksAssemblyPath}', '$(WasmAppBuilderTasksAssemblyPath)')
116116
.Replace('{MicrosoftNetCoreAppRuntimePackRidDir}', '$(MicrosoftNetCoreAppRuntimePackRidDir)')
117+
.Replace('{WasmSdkPackBuildPath}', '$(MonoProjectRoot)nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/')
118+
.Replace('{WasmSdkPackTasksPath}', '$(ArtifactsBinDir)Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/$(RuntimeConfiguration)/')
117119
.Replace('{ProductVersion}', '$(ProductVersion)')
118120
.Replace('{NetCoreAppCurrent}', '$(NetCoreAppCurrent)')
119121
.Replace('{NetCoreAppToolCurrent}', '$(NetCoreAppToolCurrent)')

0 commit comments

Comments
 (0)