Skip to content

[TrimmableTypeMap] Add CoreCLR Mono.Android.NET-Tests lane plumbing#11091

Open
simonrozsival wants to merge 14 commits intodev/simonrozsival/root-manifest-referenced-typesfrom
dev/simonrozsival/trimmable-test-plumbing
Open

[TrimmableTypeMap] Add CoreCLR Mono.Android.NET-Tests lane plumbing#11091
simonrozsival wants to merge 14 commits intodev/simonrozsival/root-manifest-referenced-typesfrom
dev/simonrozsival/trimmable-test-plumbing

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

@simonrozsival simonrozsival commented Apr 8, 2026

Summary

  • run Mono.Android.NET-Tests with _AndroidTypeMapImplementation=trimmable and UseMonoRuntime=false on CoreCLR
  • add/update the dedicated CoreCLRTrimmable lane coverage for this scenario
  • keep the currently unsupported cases explicit via temporary exclusions instead of folding broader runtime/generator work into this PR

In scope for this PR

  • CI / test-lane plumbing for _AndroidTypeMapImplementation=trimmable
  • CoreCLR test-app configuration in Mono.Android.NET-Tests.csproj
  • NUnitInstrumentation exclusions for the currently unsupported trimmable buckets, with the temporary Java.Interop-specific skips kept centralized in the test runner to avoid submodule churn:
    • Export
    • SSL
    • TrimmableIgnore
  • the focused test annotations in JnienvTest.cs and JavaObjectExtensionsTests.cs that keep the remaining gaps visible and reviewable

The existing non-Mono CoreCLRIgnore / NTLM filtering in the test project remains as-is; this PR does not expand it.

Current validation state

Manual device instrumentation on the current branch is green with the
intentional exclusions:

passed=786
skipped=6
failed=0
run=792

./dotnet-local.sh build -t:RunTestApp ... still reports a
harness/performance-data collection issue after the run, but this PR keeps
that failure surface visible instead of masking it with runtime fallback
logic.

Current exclusion footprint

The current device run reports skipped=6, but that is not the same as the
tests filtered out by the exclusion lists. Right now the temporary exclusions
cover 63 unique test methods:

  • 20 filtered by category:
    • SSL: 14
    • Export: 2
    • CoreCLRIgnore: 3 (existing non-Mono filter)
    • TrimmableIgnore: 3
  • 44 filtered by the temporary Java.Interop name list:
    • JavaObjectTest: 12
    • JavaObjectExtensionsTests: 9
    • JniPeerMembersTests: 9
    • JniTypeManagerTests: 5
    • JavaPeerableExtensionsTests: 4
    • InvokeVirtualFromConstructorTests: 3
    • JavaExceptionTests.InnerExceptionIsNotAProxy: 1
    • JniValueMarshaler_object_ContractTests: 1

There is 1 overlap between those mechanisms, which is why the totals are
20 + 44 but 63 unique filtered tests overall.

Explicitly out of scope / follow-up work

  • manifest-rooting and related generator work already covered by #11037
  • runtime fallback/workaround logic for missing trimmable typemap initialization
  • reflection-based managed-type lookup fallbacks that would mask generator bugs and would not work for NativeAOT
  • new typemap generator/scanner/build tests

Local usage

./dotnet-local.sh build -t:RunTestApp tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \
  -p:_AndroidTypeMapImplementation=trimmable \
  -p:UseMonoRuntime=false \
  -p:SupportedOSPlatformVersion=24

@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-test-plumbing branch from f8106b0 to a437455 Compare April 9, 2026 09:19
@simonrozsival simonrozsival added trimmable-type-map copilot `copilot-cli` or other AIs were used to author this labels Apr 9, 2026
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-runtime-fixes branch from d5aefaa to 3a8d509 Compare April 10, 2026 09:49
Base automatically changed from dev/simonrozsival/trimmable-runtime-fixes to main April 10, 2026 22:50
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-test-plumbing branch 2 times, most recently from 1814a6d to d0e30f6 Compare April 11, 2026 09:42
@simonrozsival simonrozsival changed the title [TrimmableTypeMap] Test plumbing and CI lane for Mono.Android.NET-Tests [TrimmableTypeMap] Stabilize CoreCLR Mono.Android.NET-Tests lane Apr 11, 2026
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-test-plumbing branch from 17b123b to e2c70fd Compare April 11, 2026 23:28
@simonrozsival simonrozsival changed the base branch from main to dev/simonrozsival/root-manifest-referenced-types April 11, 2026 23:28
simonrozsival and others added 3 commits April 12, 2026 01:44
Use _AndroidTypeMapImplementation=trimmable directly instead of a
MonoAndroidTypeMapFlavor wrapper property. This is consistent with
the actual build system property used by the typemap targets.

- _AndroidTypeMapImplementation=trimmable in CI yaml and test csproj
- UseMonoRuntime=false set when _AndroidTypeMapImplementation=trimmable
- TestsFlavor=CoreCLRTrimmable for result file naming
- ExcludeCategories: NativeTypeMap, TrimmableIgnore, SSL
- ExcludedTestNames for Java.Interop-Tests JavaObject-based fixtures

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-test-plumbing branch from e2c70fd to 87c531f Compare April 11, 2026 23:50
@simonrozsival simonrozsival changed the title [TrimmableTypeMap] Stabilize CoreCLR Mono.Android.NET-Tests lane [TrimmableTypeMap] Add CoreCLR Mono.Android.NET-Tests lane plumbing Apr 11, 2026
simonrozsival and others added 7 commits April 12, 2026 02:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival marked this pull request as ready for review April 12, 2026 08:01
Copilot AI review requested due to automatic review settings April 12, 2026 08:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds CI/test-lane plumbing to run Mono.Android.NET-Tests on CoreCLR with the trimmable typemap implementation, keeping currently-unsupported test buckets explicitly excluded to maintain green coverage while follow-up runtime/generator work lands separately.

Changes:

  • Adds a new CoreCLRTrimmable APK instrumentation lane and pins the existing CoreCLR lane to llvm-ir.
  • Updates Mono.Android.NET-Tests.csproj to default to CoreCLR + exclude trimmable-specific buckets when _AndroidTypeMapImplementation=trimmable.
  • Centralizes additional trimmable-mode runtime test exclusions in NUnitInstrumentation, and adjusts a few Java.Interop tests/projects to avoid unsupported coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs Adds runtime-switch-driven exclusions for categories and specific Java.Interop test names under trimmable typemap.
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj Sets defaults/exclusions for trimmable typemap runs (incl. CoreCLRTrimmable flavor).
tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs Marks specific tests as TrimmableIgnore.
tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JavaObjectExtensionsTests.cs Marks a specific test as TrimmableIgnore (and normalizes file header).
tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj Removes JniTypeUtf8Test.cs from compilation due to unsupported APIs in the product assembly.
build-tools/automation/yaml-templates/stage-package-tests.yaml Updates CoreCLR lane args and adds the new CoreCLRTrimmable lane.

simonrozsival and others added 2 commits April 12, 2026 14:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member Author

@simonrozsival simonrozsival left a comment

Choose a reason for hiding this comment

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

🤖 AI Review Summary

Verdict: ✅ LGTM

Found 1 suggestion:

  • 💡 Code organization — the trimmable category filtering is now split between Mono.Android.NET-Tests.csproj and NUnitInstrumentation.cs (NUnitInstrumentation.cs:29). Keeping one source of truth would make the temporary exclusions easier to retire.

The lane wiring itself looks good, and I like that the unsupported cases stay explicit instead of being hidden behind runtime fallback behavior.


Review generated by android-reviewer from review guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot `copilot-cli` or other AIs were used to author this trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants