Skip to content

Commit

Permalink
Re-enable trimming of library tests on Apple mobile (#104097)
Browse files Browse the repository at this point in the history
* Re-enable trimming of library tests on Apple mobile
  • Loading branch information
kotlarmilos authored Nov 25, 2024
1 parent f120ed6 commit 15bfb23
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ]
- name: illinkContainsChange
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono
Expand All @@ -39,8 +41,7 @@ jobs:
${{ if eq(variables['isRollingBuild'], true) }}:
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false
${{ else }}:
# Tracking issue: https://github.com/dotnet/runtime/issues/82637
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true
timeoutInMinutes: 480
# extra steps, run tests
postBuildSteps:
Expand Down
7 changes: 5 additions & 2 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -989,17 +989,19 @@ extends:
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'] ]
- name: illinkContainsChange
value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono
# Tracking issue: https://github.com/dotnet/runtime/issues/82637
buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:EnableAggressiveTrimming=false
buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:EnableAggressiveTrimming=true
timeoutInMinutes: 480
condition: >-
or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(variables['isRollingBuild'], true))
# extra steps, run tests
postBuildSteps:
Expand All @@ -1012,6 +1014,7 @@ extends:
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['illinkContainsChange'], true),
eq(variables['isRollingBuild'], true))
#
Expand Down
7 changes: 7 additions & 0 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">false</UseNativeHttpHandler>
</PropertyGroup>

<!-- When tests are built on Helix, override default trimming switches -->
<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true' and '$(BuildTestsOnHelix)' == 'true'">
<DynamicCodeSupport Condition="'$(DynamicCodeSupport)' == '' and '$(MonoForceInterpreter)' != 'true'">false</DynamicCodeSupport>
<_DefaultValueAttributeSupport Condition="'$(OverrideDefaultValueAndDesignerHostSupport)' == 'true'">true</_DefaultValueAttributeSupport>
<_DesignerHostSupport Condition="'$(OverrideDefaultValueAndDesignerHostSupport)' == 'true'">true</_DesignerHostSupport>
</PropertyGroup>

<!-- When trimming non-exe projects, root the whole intermediate assembly.
The SDK settings root only the entry point by default. These targets are used not only for standard
console apps, but also for test projects without an entry point. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<AssemblyVersion>9.9.9.9</AssemblyVersion>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'">
<OverrideDefaultValueAndDesignerHostSupport>true</OverrideDefaultValueAndDesignerHostSupport>
</PropertyGroup>

<ItemGroup>
<Compile Include="Drawing\ColorConverterTests.cs" />
<Compile Include="Drawing\PointConverterTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<DefineConstants>$(DefineConstants);ReflectionOnly</DefineConstants>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'">
<OverrideDefaultValueAndDesignerHostSupport>true</OverrideDefaultValueAndDesignerHostSupport>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\Microsoft.XmlSerializer.Generator\tests\SerializableAssembly.csproj" />
<TrimmerRootAssembly Include="SerializableAssembly" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<WithoutCategories Condition="'$(EnableAdditionalTimezoneChecks)' != 'true'">$(WithoutCategories);AdditionalTimezoneChecks</WithoutCategories>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'">
<OverrideDefaultValueAndDesignerHostSupport>true</OverrideDefaultValueAndDesignerHostSupport>
</PropertyGroup>

<ItemGroup>
<RdXmlFile Include="default.rd.xml" />
</ItemGroup>
Expand Down

0 comments on commit 15bfb23

Please sign in to comment.