-
Notifications
You must be signed in to change notification settings - Fork 566
Description
Part of #10788
Related to #11017
Summary
The CI already runs the main on-device test suite (Mono.Android.NET-Tests.csproj + Java.Interop-Tests.NET.csproj) with multiple flavors: CoreCLR, NativeAOT, Interpreter, TrimModePartial, AotLlvm, etc. (see stage-package-tests.yaml). There is no flavor that sets _AndroidTypeMapImplementation=trimmable.
Before the trimmable type map can become the default, we need to run the full existing test suite with it and triage any failures.
What to do
1. Add a new CI test flavor
Add a new entry in build-tools/automation/yaml-templates/stage-package-tests.yaml:
- testName: TrimmableTypeMap
extraBuildArgs: >-
-p:TestsFlavor=TrimmableTypeMap
-p:_AndroidTypeMapImplementation=trimmable
-p:UseMonoRuntime=false2. Handle expected exclusions
Some test categories will need to be excluded initially:
NativeTypeMap— these tests call LLVM-specific APIs (TypeManager.GetJavaToManagedType,JNIEnv.TypemapManagedToJava). Tracked separately in [TrimmableTypeMap] Refactor NativeTypeMap tests to use runtime-agnostic type map API #11018 (refactor to runtime-agnostic API).- Potentially
Export— if[Export]methods don't work yet with the trimmable path ([TrimmableTypeMap] Fix [Export] JNI signature mapping for non-primitive parameter types #11047).
Add exclusion logic in Mono.Android.NET-Tests.csproj similar to the existing CoreCLR/NativeAOT exclusions:
<ExcludeCategories Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">$(ExcludeCategories):NativeTypeMap</ExcludeCategories>3. Triage and fix failures
Run the suite, categorize failures:
- Build failures — the trimmable build pipeline doesn't handle something the test project needs
- Runtime type resolution failures — types not found in the trimmable type map
- JCW/RegisterNatives failures — Java-to-managed callbacks broken
- Binding-specific failures — specific binding patterns the scanner doesn't handle
Each distinct failure class should get its own sub-issue if not already tracked.
Acceptance criteria
- A new
TrimmableTypeMaptest flavor exists in CI - The full
Mono.Android.NET-Testssuite builds and deploys with_AndroidTypeMapImplementation=trimmable - Test results are triaged: passing tests pass, known gaps are excluded with tracking issues
- No unexpected regressions vs the CoreCLR flavor (same tests should pass minus known typemap gaps)
Dependencies
- The trimmable build pipeline must be functional end-to-end ([TrimmableTypeMap] Implement pre-trimming build task #10789, [TrimmableTypeMap] MSBuild task + targets wiring + incremental builds #10800, [TrimmableTypeMap] Build pipeline: targets, stubs, manifest integration, feature switches #11036)
- [TrimmableTypeMap] Refactor NativeTypeMap tests to use runtime-agnostic type map API #11018 should ideally land first so
NativeTypeMaptests work with both paths
Notes
This is the broadest validation of the trimmable type map. The existing test sub-issues in #11017 target specific test files; this issue is about running everything and seeing what breaks.