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

Shift Most of Wasm AOT test build to helix #48226

Merged
merged 128 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
438d530
Unraveling helix
steveisok Feb 9, 2021
4ccf81b
More helix setup
Feb 10, 2021
83760ea
Trying to keep directory names
steveisok Feb 10, 2021
0b15afc
Should be able to generate a wasm app on an island
Feb 10, 2021
adcd026
More tweaks
steveisok Feb 11, 2021
9003dc3
Better path attempts. Helix is at least trying to aot now
Feb 11, 2021
f2dc5df
Paths are correct - AOT System.Buffers works on helix
Feb 12, 2021
3ba7a82
Shift Most of Wasm AOT test build to helix
Feb 12, 2021
281cb1a
Merge remote-tracking branch 'upstream/master' into build-wasm-aot-helix
Feb 12, 2021
ed324a1
Reenable all tests
Feb 12, 2021
62b9c3e
Skip functional tests for now
Feb 12, 2021
ed62416
Copy emscripten in repo so the helix payload can be written to disk
Feb 12, 2021
4b6f7cb
update to th right darc feed for the time being
Feb 12, 2021
03d33c4
Merge remote-tracking branch 'upstream/master' into build-wasm-aot-helix
Feb 12, 2021
e1cd904
Getting deps right
Feb 13, 2021
7e0661c
Merge remote-tracking branch 'upstream/master' into build-wasm-aot-helix
Feb 13, 2021
4e7c715
Path adjustments... Should work nicely
Feb 16, 2021
573a5e7
Merge branch 'build-wasm-aot-helix' of github.com:steveisok/runtime i…
Feb 16, 2021
cac00aa
Merge remote-tracking branch 'upstream/master' into build-wasm-aot-helix
Feb 16, 2021
06a4738
Tweak linker settings to meet tests expectations
marek-safar Feb 17, 2021
4f17c4e
[testing] Add more assemblies to depend on during linking of library …
Mar 1, 2021
c0bb31b
Temporarily EnableAggressiveTrimming to discern AOT failures
Mar 1, 2021
6e7905f
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 1, 2021
b4482b6
Hardcoding pays a price ;-)
Mar 1, 2021
f60f641
[wasm] ReAdd WasmSrcPath
Mar 1, 2021
21dec7f
[wasm] Exclude System.Reflection.MetadataLoadContext from non AOT was…
Mar 1, 2021
1a4028a
[wasm] Exclude System.Reflection.MetadataLoadContext from non AOT was…
Mar 1, 2021
50df061
Added ability to bypass emcc version check back in:
Mar 1, 2021
cf14036
Preserved mscorlib for the non aot / aggressive trimming runs
Mar 2, 2021
4e7ab85
Temporarily remove exception clause preventing AOT compilation
Mar 2, 2021
a0eadd8
[wasm] Fix path to _WasmSrcPath locally
Mar 2, 2021
3deee26
Temporarily bump xharness version to see impact on wasm test reliability
Mar 2, 2021
5cc58c6
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 2, 2021
d79548d
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 6, 2021
0b4f55a
[Wasm][AOT] Isolate AOT compilation related library test failures
Mar 8, 2021
494123e
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 8, 2021
54e61db
Bump timeout
Mar 8, 2021
7594c61
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 9, 2021
8ad4515
[wasm] Bump wasm docker image and remove copying of emsdk
Mar 9, 2021
62dee6b
[wasm] Run AggressivelyTrimmed AOT wasm Library tests with AotInterp …
Mar 10, 2021
8dee79b
[wasm][AOT] Skip suite hitting MarkTypeForDynamicallyAccessedMembers …
Mar 11, 2021
047b2ba
[wasm][helix] Remove emsdk middleman
Mar 11, 2021
2e1a6ae
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 12, 2021
9901db0
Revert "[wasm] Bump wasm docker image and remove copying of emsdk"
Mar 12, 2021
60b176b
Revert "[wasm][helix] Remove emsdk middleman"
Mar 12, 2021
bb36d7c
[wasm] Bump wasm docker image
Mar 12, 2021
b1a1d40
[wasm][AOT][helix] Debug emsdk
Mar 12, 2021
7507a81
ReAdd ability to bypass emcc version check in
Mar 15, 2021
fa90a91
[wasm][helix] Test using EMSDK_PATH var directly with updated docker …
Mar 15, 2021
7c3e7bc
Revert "[wasm][AOT][helix] Debug emsdk"
Mar 16, 2021
74e8e6e
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 17, 2021
0ce162b
Merge branch 'build-wasm-aot-helix' of github.com:steveisok/runtime i…
Mar 18, 2021
cec25fa
[wasm] Utilize bits from Wasm.Build.Tests for AOT lane
Mar 18, 2021
3503330
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 18, 2021
78264e5
[wasm] Skip test suite with trim analysis error IL2103
Mar 19, 2021
ca8bf81
[wasm] Debug no test results
Mar 19, 2021
373c172
[wasm] Fix path to props and targets
Mar 19, 2021
17c2c20
[wasm] Fix path to helix MonoAOTCompiler
Mar 19, 2021
02fb795
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 19, 2021
37f23c3
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 21, 2021
27dad5d
[wasm] Fix aot-build props
Mar 21, 2021
40ecc4b
Merge branch 'build-wasm-aot-helix' of github.com:steveisok/runtime i…
Mar 26, 2021
71423cd
Merge remote-tracking branch 'upstream/main' into build-wasm-aot-helix
Mar 31, 2021
948a645
[wasm] Shift Most of Wasm AOT test build to helix
radical Apr 2, 2021
0f3c070
[wasm][aot] Use existing bits to package emsdk, and others to build apps
radical Apr 4, 2021
5bd6d01
[wasm] re-enable system.reflection tests, which are fixed with earlie…
radical Apr 4, 2021
7b977a4
Trying on CI now
radical Apr 4, 2021
b859c85
[wasm][tests][eat] disable System.Linq.Expression tests
radical Apr 5, 2021
102d583
[wasm] Disable failing tests, and add tracking issues
radical Apr 5, 2021
cc5ca0d
Disable more tests
radical Apr 5, 2021
25f2a36
Fix Wasm.Build tests
radical Apr 5, 2021
488b2f8
remove debug stuff
radical Apr 5, 2021
06eabc0
re-enable the builds that were disabled for quick testing
radical Apr 5, 2021
64faaf9
fix RunTests.sh
radical Apr 5, 2021
8ad9bdf
cleanup
radical Apr 5, 2021
79b0f85
Merge commit 'ec1e392528a8c5db4d3799c98d31e75f6d26319e' into build-wa…
radical Apr 5, 2021
009418f
Merge branch 'wasm-aot-helix-aj' into build-wasm-aot-helix
radical Apr 5, 2021
763e91e
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 5, 2021
a83cf79
Fix Version.Details.xml to match main
radical Apr 5, 2021
a4e5797
cleanup
radical Apr 5, 2021
2bddacf
set EMSDK_PATH for run-tests- targets
radical Apr 5, 2021
cac4de8
[wasm][tests][aot] Allow replicating the aot/eat test runs locally
radical Apr 7, 2021
6e63861
[wasm][tests][aot] Propogate wasm properties from the original project
radical Apr 7, 2021
403c155
Document the AOT library test setup
radical Apr 7, 2021
2856767
Fix path for extraFiles
radical Apr 7, 2021
16c2004
Set EMSDK_PATH in case of WasmBuildSupportDir
radical Apr 7, 2021
ac3f736
Fix WasmBuildSupportDir path
radical Apr 7, 2021
0f6f549
[wasm] Rename the BuildWasmAOT properties to BuildAOT, to be usable f…
radical Apr 7, 2021
7bbb390
Fix building the test command line for Wasm.Build.Tests
radical Apr 7, 2021
717abec
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 7, 2021
ef06d0d
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix-…
radical Apr 9, 2021
19d0646
Merge branch 'main' into build-wasm-aot-helix
radical Apr 12, 2021
6dd7607
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 12, 2021
0399ccf
[wasm] Make sure env vars for test args can be set for the run script
radical Apr 12, 2021
9aea5cf
tests.wasm.targets: Remove unncessary conditions
radical Apr 12, 2021
9f5d10c
[wasm] Fix support for satellite assemblies, and pdb files
radical Apr 12, 2021
4742f4b
[wasm] Fix trimming errors for System.Runtime.Loader.Tests
radical Apr 11, 2021
b14d0ff
[wasm] tests.wasm.targets Set DebuggerSupport, only it wasn't set alr…
radical Apr 13, 2021
02c3bcb
[wasm] fix build error for System.Diagnostics.StackTrace.Tests
radical Apr 13, 2021
14f7437
Bump chromedriver version to current stable
radical Apr 13, 2021
b7c308f
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 13, 2021
854fb34
Revert "Bump chromedriver version to current stable"
radical Apr 14, 2021
e6be69f
[wasm] Fix build
radical Apr 14, 2021
73052fd
[wasm] Fix trimming errors for System.Collections.Immutable.Tests
radical Apr 14, 2021
b753d5e
[wasm] Fix trimming errors for System.Collections.Tests
radical Apr 14, 2021
34105a1
[wasm] Disable some tests
radical Apr 14, 2021
a1cd01c
[wasm] Fix errors due to trimming for Microsoft.CSharp.Tests
radical Apr 14, 2021
a741040
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 14, 2021
867a381
[wasm] Disable broken test System.Xml.Tests.CTransformRegressionTest.…
radical Apr 14, 2021
9884055
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 15, 2021
b09c9cb
System.ComponentModel.TypeConverter: fix path to il descriptors file
radical Apr 15, 2021
79fa75b
[wasm] Fix build errors due to trimming in System.Reflection.Metadata…
radical Apr 15, 2021
0ec0210
Skip xunit trimming descriptors for wasm build tests
radical Apr 16, 2021
f81fde9
[wasm] Fix tests skipped, or not discovered due to trimming
radical Apr 16, 2021
f33e181
[wasm] Disable broken test System.Data.Tests.XmlDataReaderTest.XmlLoa…
radical Apr 16, 2021
fec5a71
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix
radical Apr 20, 2021
77184f6
Revert "[wasm] Fix build errors due to trimming in System.Reflection.…
radical Apr 20, 2021
5021fec
Revert "[wasm] Fix trimming errors for System.Runtime.Loader.Tests"
radical Apr 20, 2021
da1aca9
[wasm] Disable System.Reflection.MetadataLoadContext tests
radical Apr 20, 2021
ec9255c
Revert "[wasm] Disable broken test System.Xml.Tests.CTransformRegress…
radical Apr 20, 2021
29aed77
Revert "[wasm] Disable broken test System.Data.Tests.XmlDataReaderTes…
radical Apr 20, 2021
50dddbb
[wasm] Disable failing tests build for System.ComponentModel.Primitiv…
radical Apr 21, 2021
160f053
Disable System.Data.Common.Tests
radical Apr 21, 2021
17693cd
Disable System.Text.Json.Tests
radical Apr 21, 2021
fcfb527
disable System.Xml.Xsl.XslCompiledTransformApi.Tests
radical Apr 21, 2021
04e7f99
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix-…
radical Apr 21, 2021
4f95a05
Merge remote-tracking branch 'origin/main' into build-wasm-aot-helix-…
radical Apr 21, 2021
6bee3b7
[wasm] Disable System.ComponentModel.TypeConverter.Tests
radical Apr 21, 2021
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
15 changes: 15 additions & 0 deletions docs/workflow/testing/libraries/testing-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ At the moment supported values are:

By default, `chrome` browser is used.

## AOT library tests

- Building library tests with AOT, and (even) with `EnableAggressiveTrimming` takes 3-9mins on CI, and that adds up for all the assemblies, causing
a large build time. To circumvent that on CI, we build the test assemblies on the build machine, but skip the WasmApp build part of it, since
that includes the expensive AOT step.

- Instead, we take the built test assembly+dependencies, and enough related bits to be able to run the `WasmBuildApp` target, with the original
inputs.

- To recreate a similar build+test run locally, add `/p:BuildAOTTestsOnHelix=true` to the usual command line.
- For example, with `./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release`

- AOT: add `/p:EnableAggressiveTrimming=true /p:RunAOTCompilation=true /p:BuildAOTTestsOnHelix=true`
- Only trimming (helpful to isolate issues caused by trimming):
- add `/p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true`
## Debugging

### Getting more information
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
targetRid: browser-wasm
platform: Browser_wasm
container:
image: ubuntu-18.04-webassembly-20210223133559-4800846
image: ubuntu-18.04-webassembly-20210309143118-005aab4
Copy link
Member

Choose a reason for hiding this comment

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

@steveisok @mdh1418 Do you know why this change was made? main is still using the older version.

Copy link
Member

Choose a reason for hiding this comment

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

judging from the date it's to bring in dotnet/dotnet-buildtools-prereqs-docker@f25f6cd

registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
Expand Down
44 changes: 42 additions & 2 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,47 @@ jobs:
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_AOT
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:EnableAggressiveTrimming=true /p:RunAOTCompilation=true
timeoutInMinutes: 120
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true
scenarios:
- normal
condition: >-
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['isFullMatrix'], true))

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- Browser_wasm
variables:
# map dependencies variables to local variables
- name: librariesContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_EAT
buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
Expand All @@ -218,6 +257,7 @@ jobs:
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true
scenarios:
- normal
condition: >-
Expand Down
5 changes: 5 additions & 0 deletions eng/testing/ILLink.Descriptor.TestUtilities.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<linker>
<assembly fullname="TestUtilities">
<namespace fullname="System" />
</assembly>
</linker>
3 changes: 2 additions & 1 deletion eng/testing/ILLink.Descriptor.xunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<assembly fullname="Microsoft.DotNet.XUnitExtensions" />
<assembly fullname="xunit.core">
<namespace fullname="Xunit" />
<namespace fullname="Xunit.Sdk" />
</assembly>
<assembly fullname="xunit.runner.utility.netcoreapp10" />
<assembly fullname="xunit.runner.utility.netcoreapp10" />
</linker>
5 changes: 3 additions & 2 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<BundleAssemblies Condition="'$(RunAOTCompilation)' != 'true'" Include="$(PublishDir)*.dll" />
</ItemGroup>

<MakeDir Directories="$(_MobileIntermediateOutputPath)"
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
Condition="'$(RunAOTCompilation)' == 'true'"/>
<RemoveDir Directories="$(BundleDir)" />

Expand Down Expand Up @@ -243,7 +243,8 @@
</ItemGroup>

<ItemGroup>
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.xunit.xml" />
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.xunit.xml" Condition="'$(SkipXunitTrimmerDescriptor)' != 'true'" />
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.TestUtilities.xml" Condition="'$(SkipTestUtilitiesReference)' != 'true'" />
</ItemGroup>
</Target>

Expand Down
134 changes: 113 additions & 21 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
<PropertyGroup>
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
<!-- Some tests expect to load satellite assemblies by path, eg. System.Runtime.Loader.Tests,
so, just setting it true by default -->
<IncludeSatelliteAssembliesInVFS Condition="'$(IncludeSatelliteAssembliesInVFS)' == ''">true</IncludeSatelliteAssembliesInVFS>
</PropertyGroup>

<PropertyGroup>
<BuildAOTTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildWasmApps'">helix</BuildAOTTestsOn>
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">helix</BuildAOTTestsOn>
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOn)' == ''">local</BuildAOTTestsOn>
</PropertyGroup>

<PropertyGroup Condition="'$(RunScriptCommand)' == ''">
Expand All @@ -14,49 +23,119 @@

<_XHarnessArgs Condition="'$(Scenario)' != 'WasmTestOnBrowser'">$(_XHarnessArgs) --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js</_XHarnessArgs>
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != '' and '$(OS)' != 'Windows_NT'">$(_XHarnessArgs) $(WasmXHarnessArgs) %24WasmXHarnessArgs</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != '' and '$(OS)' == 'Windows_NT'">$(_XHarnessArgs) $(WasmXHarnessArgs) %WasmXHarnessArgs%</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)</_XHarnessArgs>

<_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll</_AppArgs>
<_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll --testing</_AppArgs>

<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs) %24WasmTestAppArgs</_AppArgs>
<RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs)</RunScriptCommand>
<RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">%HARNESS_RUNNER% $(_XHarnessArgs) -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs)</RunScriptCommand>
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)</_AppArgs>

<RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs</RunScriptCommand>
<RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) %WasmXHarnessArgs% -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs%</RunScriptCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'">
<_AOTBuildCommand>dotnet msbuild publish/AOTTestProjectForHelix.proj /bl:$XHARNESS_OUT/AOTBuild.binlog</_AOTBuildCommand>

<!-- running aot-helix tests locally, so we can test with the same project file as CI -->
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand>

<_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation)</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) &amp;&amp; cd wasm_build/AppBundle</_AOTBuildCommand>

<RunScriptCommand Condition="'$(RunScriptCommand)' == ''">$(_AOTBuildCommand)</RunScriptCommand>
<RunScriptCommand Condition="'$(RunScriptCommand)' != ''">$(_AOTBuildCommand) &amp;&amp; $(RunScriptCommand)</RunScriptCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(UseDefaultBlazorWASMFeatureSwitches)' == 'true'">
<EventSourceSupport>false</EventSourceSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<UseSystemResourceKeys>false</UseSystemResourceKeys>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>

<!-- we want to default to what Blazor has, except if we are building in Debug config -->
<DebuggerSupport Condition="'$(Configuration)' != 'Debug'">false</DebuggerSupport>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
</PropertyGroup>
Comment on lines 50 to 58
Copy link
Member

Choose a reason for hiding this comment

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

Some these need to have values different from what UseDefaultBlazorWasmFeatureSwitches wants:

  • DebuggerSupport - this is needed by some library tests because they depend on pdbs, or debugger attributes
    • Currently, I am setting this in the specific projects that need it
  • UseSystemResourceKeys - IIUC, this is needed so that the resources don't get trimmed, which is needed by some library tests

Setting these only for some library projects makes it kinda inconsistent. And I'm wondering if that affects what the intention of UseDefaultBlazorWasmFeatureSwitches is.
So, do we need switch at all? If so, then what should be done here?

/cc @lewing @akoeplinger

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @radical, the intention of UseDefaultBlazorWASMFeatureSwitches is to make us consistent with Blazor. I think overriding in the individual library test projects where necessary is fine for now.


<!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.props" />
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.InTree.targets" />
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.props"
Condition="'$(BuildAOTTestsOn)' == 'local'" />
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.InTree.targets"
Condition="'$(BuildAOTTestsOn)' == 'local'" />

<PropertyGroup>
<WasmBuildAppDependsOn>PrepareForWasmBuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
<EmSdkDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDir>
<EmSdkDirForHelixPayload>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDirForHelixPayload>

<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'local'">WasmBuildApp</BundleTestWasmAppDependsOn>
<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'helix'">StageEmSdkForHelix</BundleTestWasmAppDependsOn>

<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">$(BundleTestWasmAppDependsOn);_BundleAOTTestWasmAppForHelix</BundleTestWasmAppDependsOn>
</PropertyGroup>

<Target Name="BundleTestWasmApp" DependsOnTargets="WasmBuildApp;StageEmSdkForHelix" />
<Target Name="BundleTestWasmApp" DependsOnTargets="$(BundleTestWasmAppDependsOn)" />

<UsingTask Condition="'$(BuildAOTTestsOnHelix)' == 'true'"
TaskName="Microsoft.WebAssembly.Build.Tasks.GenerateAOTProps"
AssemblyFile="$(WasmBuildTasksAssemblyPath)" />

<Target Name="_BundleAOTTestWasmAppForHelix" DependsOnTargets="PrepareForWasmBuildApp">
<ItemGroup>
<BundleFiles Include="$(WasmMainJSPath)" TargetDir="publish" />
<BundleFiles Include="@(WasmSatelliteAssemblies)" TargetDir="publish/%(WasmSatelliteAssemblies.CultureName)" />
<BundleFiles Include="@(WasmAssembliesToBundle)" TargetDir="publish" />

<BundleFiles Include="$(MonoProjectRoot)\wasm\data\aot-tests\*" TargetDir="publish" />
</ItemGroup>

<ItemGroup Condition="'$(DebuggerSupport)' == 'true'">
<!-- Add any pdb files, if available -->
<_BundlePdbFiles Include="$([System.IO.Path]::ChangeExtension('%(WasmAssembliesToBundle.Identity)', '.pdb'))" />
<BundleFiles Include="@(_BundlePdbFiles)" TargetDir="publish" Condition="Exists(%(_BundlePdbFiles.Identity))" />
</ItemGroup>

<!-- To recreate the original project on helix, we need to set the wasm properties also, same as the
library test project. Eg. $(InvariantGlobalization) -->
Copy link
Member

@akoeplinger akoeplinger Apr 21, 2021

Choose a reason for hiding this comment

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

do we have a way of knowing the list of properties is complete or when we need to update it?

Copy link
Member

Choose a reason for hiding this comment

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

Um .. not really. So, when something breaks? I didn't add all the properties either, because I want to do that as it comes up.

<ItemGroup>
<_WasmPropertyNames Include="InvariantGlobalization" />
<_WasmPropertyNames Include="AOTMode" />
<_WasmPropertyNames Include="WasmDebugLevel" />
<_WasmPropertyNames Include="WasmBuildNative" />
<_WasmPropertyNames Include="_WasmDevel" />
<_WasmPropertyNames Include="WasmLinkIcalls" />
<_WasmPropertyNames Include="WasmDedup" />
<_WasmPropertyNames Include="IncludeSatelliteAssembliesInVFS" />

<_WasmPropertiesToPass
Include="$(%(_WasmPropertyNames.Identity))"
Name="%(_WasmPropertyNames.Identity)"
ConditionToUse="%(_WasmPropertyNames.ConditionToUse)" />

<_WasmVFSFilesToCopy Include="@(WasmFilesToIncludeInFileSystem)" />
<_WasmVFSFilesToCopy TargetPath="%(FileName)%(Extension)" Condition="'%(TargetPath)' == ''" />
</ItemGroup>

<!-- This file gets imported by the project file on helix -->
<GenerateAOTProps
Properties="@(_WasmPropertiesToPass)"
OutputFile="$(BundleDir)publish\AOTTestProjectForHelix.props" />

<Copy SourceFiles="@(BundleFiles)" DestinationFolder="$(BundleDir)%(TargetDir)" />
<Copy SourceFiles="@(_WasmVFSFilesToCopy)" DestinationFiles="$(BundleDir)\extraFiles\%(_WasmVFSFilesToCopy.TargetPath)" />
</Target>

<!-- CI has emscripten provisioned in $(EMSDK_PATH) as `/usr/local/emscripten`. Because helix tasks will
attempt to write a .payload file, we cannot use $(EMSDK_PATH) to package emsdk as a helix correlation
payload. Instead, we copy over the files to a new directory `src/mono/wasm/emsdk` and use that. -->
<Target Name="StageEmSdkForHelix" Condition="'$(Scenario)' == 'BuildWasmApps' and '$(ContinuousIntegrationBuild)' == 'true' and !Exists($(EmSdkDir))">
<Error Condition="!Exists($(EMSDK_PATH))" Text="Could not find emscripten sdk in $(EmSdkDir) or in EMSDK_PATH=$(EMSDK_PATH)" />
<Target Name="StageEmSdkForHelix" Condition="'$(EmSdkDirForHelixPayload)' == '' or !Exists($(EmSdkDirForHelixPayload))">
<Error Condition="'$(EMSDK_PATH)' == '' or !Exists($(EMSDK_PATH))" Text="Could not find emscripten sdk in $(EmSdkDirForHelixPayload) or in EMSDK_PATH=$(EMSDK_PATH)" />

<ItemGroup>
<EmSdkFiles Include="$(EMSDK_PATH)\**\*" Exclude="$(EMSDK_PATH)\.git\**\*" />
</ItemGroup>

<MakeDir Directories="$(EmSdkDir)" />
<Copy SourceFiles="@(EmSdkFiles)" DestinationFolder="$(EmSdkDir)\%(RecursiveDir)" />
<MakeDir Directories="$(EmSdkDirForHelixPayload)" />
<Copy SourceFiles="@(EmSdkFiles)" DestinationFolder="$(EmSdkDirForHelixPayload)\%(RecursiveDir)" />
</Target>

<Target Name="PrepareForWasmBuildApp">
Expand All @@ -74,17 +153,30 @@

<ItemGroup>
<WasmSatelliteAssemblies Include="$(PublishDir)*\*.resources.dll" />
<WasmSatelliteAssemblies>
<CultureName>$([System.IO.Directory]::GetParent('%(Identity)').Name)</CultureName>
</WasmSatelliteAssemblies>
<WasmSatelliteAssemblies CultureName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" />

<WasmAssembliesToBundle Include="$(PublishDir)\*.dll"/>

<WasmFilesToIncludeInFileSystem Include="@(ContentWithTargetPath)" />
<WasmFilesToIncludeInFileSystem Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.BuildReference)' == 'true' and !$([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('.resources.dll'))" />
<WasmFilesToIncludeInFileSystem Include="@(WasmSatelliteAssemblies)" TargetPath="%(WasmSatelliteAssemblies.CultureName)\%(WasmSatelliteAssemblies.Filename)%(WasmSatelliteAssemblies.Extension)" />
<WasmFilesToIncludeInFileSystem
Include="@(WasmSatelliteAssemblies)"
TargetPath="%(WasmSatelliteAssemblies.CultureName)\%(WasmSatelliteAssemblies.FileName)%(WasmSatelliteAssemblies.Extension)"
Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true'" />

<_CopyLocalPaths
Include="@(PublishItemsOutputGroupOutputs)"
Condition="'%(PublishItemsOutputGroupOutputs.BuildReference)' == 'true' and
!$([System.String]::new('%(PublishItemsOutputGroupOutputs.Identity)').EndsWith('.resources.dll'))" />

<_CopyLocalPaths TargetPath="%(_CopyLocalPaths.RelativePath)" Condition="'%(_CopyLocalPaths.RelativePath)' != ''" />
<_CopyLocalPaths TargetPath="%(FileName)%(Extension)" Condition="'%(_CopyLocalPaths.RelativePath)' == ''" />
<WasmFilesToIncludeInFileSystem Include="@(_CopyLocalPaths)" />

<!-- Include files specified by test projects from publish dir -->
<WasmFilesToIncludeInFileSystem Include="@(WasmFilesToIncludeFromPublishDir -> '$(PublishDir)%(Identity)')" />
<WasmFilesToIncludeInFileSystem
Include="$(PublishDir)%(WasmFilesToIncludeFromPublishDir.Identity)"
TargetPath="%(WasmFilesToIncludeFromPublishDir.Identity)"
Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Operator '-' cannot be applied to operands of type 'ushort' and 'EnumArithmeticTests.UInt16Enum'"
-->
<Features>$(Features.Replace('strict', '')</Features>

<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'Browser'">true</DebuggerSupport>
</PropertyGroup>
<ItemGroup>
<Compile Include="AccessTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'Browser'">true</DebuggerSupport>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CoreLibSharedDir)System\Collections\Concurrent\IProducerConsumerCollectionDebugView.cs"
Expand Down Expand Up @@ -70,4 +71,4 @@
<Compile Include="$(CommonTestPath)System\Collections\IEnumerable.Generic.Serialization.Tests.cs"
Link="Common\System\Collections\IEnumerable.Generic.Serialization.Tests.cs" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<NoWarn>0436</NoWarn>
<TargetFrameworks>$(NetCoreAppCurrent);net461</TargetFrameworks>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'Browser'">true</DebuggerSupport>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)System\Collections\DictionaryExtensions.cs" Condition="'$(TargetFramework)' == 'net461'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'Browser'">true</DebuggerSupport>
Copy link
Member

Choose a reason for hiding this comment

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

curious why does this need .pdb?

Copy link
Member

Choose a reason for hiding this comment

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

Eg:

  fail: [FAIL] System.Collections.Tests.HashtableTests.DebuggerAttribute
  info: System.InvalidOperationException : Expected one DebuggerDisplayAttribute on System.Collections.Hashtable.
  info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj)
  info:    at System.Collections.Tests.HashtableTests.DebuggerAttribute()
  info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

 fail: [FAIL] System.Collections.Tests.QueueTests.DebuggerAttribute_NullQueue_ThrowsArgumentNullException
  info: System.InvalidOperationException : Expected one DebuggerTypeProxyAttribute on System.Collections.Queue.
  info:    at System.Diagnostics.DebuggerAttributes.GetProxyType(Type type, Type[] genericTypeArguments)
  info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Type[] genericTypeArguments, Object obj)
  info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerTypeProxyProperties(Type type, Object obj)
  info:    at System.Collections.Tests.QueueTests.DebuggerAttribute_NullQueue_ThrowsArgumentNullException()
  info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

</PropertyGroup>
<ItemGroup>
<!-- Common Collections tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<TestRuntime>true</TestRuntime>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'Browser'">true</DebuggerSupport>
</PropertyGroup>
<ItemGroup>
<!-- Common Collections tests -->
Expand Down
Loading