Skip to content

Commit

Permalink
[libraries] Move library tests Feature Switches defaults to Functiona…
Browse files Browse the repository at this point in the history
…l tests (#53253)

* [libraries] Remove UseSystemResourceKeys true default

* [libraries] Remove UseSystemResourceKeys for iOS

* [libraries] Resolve WebSockets System resource keys activeissue

* [tests] Move default feature switches from libraries to functional tests

* [tests] Move Browser wasm default switches into FuntionalTests scope

* Add Browser OS condition

* Move DefaultFeatureSwitches initialization to FunctionalTests project

* Consolidate trimming framework library features and condition for libraries with EnableAggressiveTrimming

* [testing][EAT] Revert trimming framework library features to browser defaults for enable aggressive trimming

* [tests] Add Xamarin Android, Xamarin Mac/iOS, and Wasm feature defaults to Functional tests

* Fixup tabs to spaces

* Add common feature switches, links, and cleanup

* Cleanup Xamarin Android link

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
  • Loading branch information
mdh1418 and Mitchell Hwang committed May 29, 2021
1 parent 1ffa574 commit c6b5994
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 40 deletions.
3 changes: 0 additions & 3 deletions eng/testing/linker/SupportFiles/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<Project>
<PropertyGroup>
<SkipConfigureTrimming>true</SkipConfigureTrimming>
<UseDefaultBlazorWASMFeatureSwitches>false</UseDefaultBlazorWASMFeatureSwitches>
<UseDefaultAndroidFeatureSwitches>false</UseDefaultAndroidFeatureSwitches>
<UseDefaultiOSFeatureSwitches>false</UseDefaultiOSFeatureSwitches>
<PublishTrimmed>true</PublishTrimmed>
<SkipImportRepoLinkerTargets>true</SkipImportRepoLinkerTargets>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
Expand Down
31 changes: 7 additions & 24 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,20 @@
<RunAOTCompilation Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">true</RunAOTCompilation>

<PublishingTestsRun>true</PublishingTestsRun>
<UseDefaultBlazorWASMFeatureSwitches Condition="'$(UseDefaultBlazorWASMFeatureSwitches)' == ''">true</UseDefaultBlazorWASMFeatureSwitches>
<UseDefaultAndroidFeatureSwitches Condition="'$(UseDefaultAndroidFeatureSwitches)' == ''">true</UseDefaultAndroidFeatureSwitches>
<UseDefaultiOSFeatureSwitches Condition="'$(UseDefaultiOSFeatureSwitches)' == ''">true</UseDefaultiOSFeatureSwitches>
<BundleTestAppTargets>BundleTestAppleApp;BundleTestAndroidApp</BundleTestAppTargets>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'Android' and '$(UseDefaultAndroidFeatureSwitches)' == 'true'">
<DebuggerSupport>false</DebuggerSupport>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EventSourceSupport>false</EventSourceSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<StartupHookSupport>false</StartupHookSupport>
<UseNativeHttpHandler>true</UseNativeHttpHandler>
</PropertyGroup>

<PropertyGroup Condition="('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator') and '$(UseDefaultiOSFeatureSwitches)' == 'true'">
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport>false</EventSourceSupport>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<StartupHookSupport>false</StartupHookSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
<UseNativeHttpHandler>true</UseNativeHttpHandler>
</PropertyGroup>

<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true'">
<PublishTrimmed>true</PublishTrimmed>
<!-- Suppress linker warnings as these are tests -->
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>

<!-- Reduce library test app size by trimming framework library features -->
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">false</UseSystemResourceKeys>
</PropertyGroup>

<PropertyGroup>
Expand Down
10 changes: 0 additions & 10 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@
<RunScriptCommand Condition="'$(RunScriptCommand)' != ''">$(_AOTBuildCommand) &amp;&amp; $(RunScriptCommand)</RunScriptCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(UseDefaultBlazorWASMFeatureSwitches)' == 'true'">
<EventSourceSupport>false</EventSourceSupport>
<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="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
</PropertyGroup>

<!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.props"
Condition="'$(BuildAOTTestsOn)' == 'local'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ public async Task LargeMessageSplitInMultipleFrames(int windowBits)
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/52645", TestPlatforms.Android)]
public async Task WebSocketWithoutDeflateShouldThrowOnCompressedMessage()
{
WebSocketTestStream stream = new();
Expand All @@ -364,7 +363,6 @@ public async Task WebSocketWithoutDeflateShouldThrowOnCompressedMessage()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/52645", TestPlatforms.Android)]
public async Task ReceiveUncompressedMessageWhenCompressionEnabled()
{
// We should be able to handle the situation where even if we have
Expand Down Expand Up @@ -401,7 +399,6 @@ public async Task ReceiveUncompressedMessageWhenCompressionEnabled()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/52645", TestPlatforms.Android)]
public async Task ReceiveInvalidCompressedData()
{
WebSocketTestStream stream = new();
Expand Down
35 changes: 35 additions & 0 deletions src/tests/FunctionalTests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,40 @@
<IsFunctionalTest>true</IsFunctionalTest>
</PropertyGroup>

<!-- Available feature switches: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md -->
<PropertyGroup Condition="'$(TargetsMobile)' == 'true'">
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
</PropertyGroup>

<!-- Modeled after Microsoft.Android.Sdk.ILLink.targets https://github.com/xamarin/xamarin-android/blob/main/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets -->
<PropertyGroup Condition="'$(TargetOS)' == 'Android'">
<DebuggerSupport Condition="'$(DebuggerSupport)' == ''">false</DebuggerSupport>
<EnableUnsafeBinaryFormatterSerialization Condition="'$(EnableUnsafeBinaryFormatterSerialization)' == ''">false</EnableUnsafeBinaryFormatterSerialization>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' != 'true'"></InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler>
</PropertyGroup>

<!-- Modeled after Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets https://github.com/dotnet/sdk/blob/main/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets -->
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
</PropertyGroup>

<!-- Modeled after Xamarin.Shared.Sdk.targets https://github.com/xamarin/xamarin-macios/blob/main/dotnet/targets/Xamarin.Shared.Sdk.targets -->
<PropertyGroup Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'MacCatalyst'">
<CustomResourceTypesSupport Condition="'$(CustomResourceTypesSupport)' == ''">false</CustomResourceTypesSupport>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
<DebuggerSupport Condition="'$(DebuggerSupport)' == ''">false</DebuggerSupport>
<EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization Condition="'$(EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization)' == ''">false</EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization>
<EnableUnsafeBinaryFormatterSerialization Condition="'$(EnableUnsafeBinaryFormatterSerialization)' == ''">false</EnableUnsafeBinaryFormatterSerialization>
<InvariantGlobalization Condition="'$(TargetOS)' == 'MacCatalyst' and '$(InvariantGlobalization)' == ''">true</InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler>
</PropertyGroup>

<Import Project="..\..\libraries\Directory.Build.props" />
</Project>

0 comments on commit c6b5994

Please sign in to comment.