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

[browser][icu][libraries] Load full ICU in library tests only when it's necessary #82619

Merged
merged 7 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
8 changes: 5 additions & 3 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<PropertyGroup>
<IsBrowserWasmProject Condition="'$(IsBrowserWasmProject)' == ''">true</IsBrowserWasmProject>

<!-- some tests require full ICU data, force it for all the tests -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>

<!-- set this when provisioning emsdk on CI -->
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk'))</EMSDK_PATH>

Expand All @@ -35,6 +32,11 @@
<_BundleAOTTestWasmAppForHelixDependsOn>$(_BundleAOTTestWasmAppForHelixDependsOn);PrepareForWasmBuildApp;_PrepareForAOTOnHelix</_BundleAOTTestWasmAppForHelixDependsOn>
</PropertyGroup>

<!-- trimming tests InvariantGlobalizationFalse require full ICU data -->
<PropertyGroup Condition="'$(TestTrimming)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

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

Why only when 'TestTrimming' ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's the story:
I made this PR to reduce the number of tests that run with this flag set to true to minimum. However, I was not able to make InvariantGlobalizationFalse.cs in trimming tests pass - even setting the Property straight in that test d1f019b was not woring - when we were entering WasmApp.targets the value was already trimmed.
I came up with the workaround: I won't set the flag for all the tests in tests.browser.targets but only for the trimming ones, to make InvariantGlobalizationFalse.cs pass.

Copy link
Member

Choose a reason for hiding this comment

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

You also need '$(IsTrimmingTestProject)' == 'true'. $(TestTrimming) would be set for the whole build, but it is relevant only for trimming projects which will have $(IsTrimmingTestProject) set. At least based on reading the code:)

Copy link
Member Author

@ilonatommy ilonatommy Feb 28, 2023

Choose a reason for hiding this comment

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

Changing it to IsTrimmingTestProject breaks the test again. It has to be connected with the order of MsBuild files evaluation, because for the discussed test both flags: IsTrimmingTestProject and TestTrimming are true in the binlog. So it must be that we are reading test.browser.targets before we read Directory.Build.props where IsTrimmingTestProject value is set. TestTrimming is set in src/libraries/tests.proj and is already availabe in the line quoted.
Conclusion: the condition has to stay as it is.

Copy link
Member

Choose a reason for hiding this comment

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

I'm confused about it. Do all combinations 4 of trimming and invariant work for native rebuild ?
Is this just issue with unit testing ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We took it offline with Pavel and it's not about trimming but about these files being used in different builds. That is why values set in one of them are not reflected in the other.

Copy link
Member

Choose a reason for hiding this comment

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

There is nested MSBuild which didn't receive WasmIncludeFullIcuData from System.Runtime.TrimmingTests.proj

image

And then full file is not there!

image

<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>

<!-- On CI this is installed as part of pretest, but it should still be installed
for WBT, and debugger tests -->
<Import Project="$(MSBuildThisFileDirectory)wasm-provisioning.targets"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(TargetOS)' == 'browser'">true</DebuggerSupport>

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>
<ItemGroup>
<!-- Common Collections tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TestRuntime>true</TestRuntime>

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Globalization\CalendarTestBase.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<UnicodeUcdVersion>15.0</UnicodeUcdVersion>

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>
<ItemGroup>
<RdXmlFile Include="default.rd.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<EnableLibraryImportGenerator>true</EnableLibraryImportGenerator>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser</TargetFrameworks>

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<!-- Disable nullability public only feature for NullabilityInfoContextTests -->
<Features>$(Features.Replace('nullablePublicOnly', '')</Features>

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>

<!-- The test is looking for debugger attributes we would have stripped with NativeAOT -->
<IlcKeepManagedDebuggerSupport>true</IlcKeepManagedDebuggerSupport>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest> <!-- to avoid OOMs with source generation in wasm: https://github.com/dotnet/runtime/pull/60701 -->

<!-- some tests require full ICU data, force it -->
<WasmIncludeFullIcuData>true</WasmIncludeFullIcuData>
</PropertyGroup>
<ItemGroup>
<Compile Include="AttRegexTests.cs" />
Expand Down