Skip to content

[TrimmableTypeMap] Integration parity tests#10827

Merged
jonathanpeppers merged 10 commits into
dotnet:mainfrom
simonrozsival:dev/simonrozsival/ttm-slice-integration
Mar 10, 2026
Merged

[TrimmableTypeMap] Integration parity tests#10827
jonathanpeppers merged 10 commits into
dotnet:mainfrom
simonrozsival:dev/simonrozsival/ttm-slice-integration

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Feb 18, 2026

Copy link
Copy Markdown
Member

Stacked on #10823.
Part of #10798

Scope

  • Integration test project setup
  • UserTypes fixture assembly used by parity tests
  • Side-by-side scanner parity tests against legacy behavior
  • CI wiring for integration test execution

Review guide

Two commits — review in order:

  1. Integration parity test slice — test project, UserTypes fixture, and scanner comparison tests
  2. Wire integration tests into solution and CI — .sln entries, CI yaml, InternalsVisibleTo

@simonrozsival simonrozsival added Area: NativeAOT Issues that only occur when using NativeAOT. Area: CoreCLR Issues that only occur when using CoreCLR. copilot `copilot-cli` or other AIs were used to author this trimmable-type-map labels Feb 18, 2026
@simonrozsival
simonrozsival changed the base branch from dev/simonrozsival/java-peer-scanner-core to main February 18, 2026 15:57
@simonrozsival
simonrozsival marked this pull request as ready for review February 18, 2026 16:04
Copilot AI review requested due to automatic review settings February 18, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an integration test slice for TrimmableTypeMap scanner parity by building a real-user-types fixture assembly and running side-by-side comparisons against the legacy Cecil-based scanner, then wires these integration tests into the solution and Windows CI.

Changes:

  • Add Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests project with scanner parity/comparison tests (Mono.Android + user fixture).
  • Add UserTypesFixture project to produce a “real user types” assembly referencing Mono.Android/Java.Interop.
  • Wire the integration tests into Xamarin.Android.sln, add InternalsVisibleTo, and run/publish results in the Windows CI steps.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/UserTypesFixture/UserTypesFixture.csproj New fixture project that compiles user-type edge cases and outputs DLL next to integration tests.
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/UserTypesFixture/UserTypes.cs User-type fixture source covering component attributes, nested types, [Export], etc.
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/ScannerComparisonTests.cs New parity tests comparing legacy scanner output vs new SRM-based scanner across multiple dimensions.
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/MockBuildEngine.cs Minimal IBuildEngine stub for TaskLoggingHelper usage in scanner tests.
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests.csproj New xUnit integration test project referencing TrimmableTypeMap + Build.Tasks + fixture build output.
src/Xamarin.Android.Build.Tasks/Properties/AssemblyInfo.cs Adds InternalsVisibleTo for the new integration test assembly.
build-tools/automation/yaml-templates/build-windows-steps.yaml Runs/publishes TrimmableTypeMap integration tests in Windows CI.
Xamarin.Android.sln Adds the new integration test and fixture projects to the solution.

Comment thread build-tools/automation/yaml-templates/build-windows-steps.yaml
@simonrozsival

Copy link
Copy Markdown
Member Author

/azp run Xamarin.Android-PR

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@simonrozsival

Copy link
Copy Markdown
Member Author

/azp run Xamarin.Android-PR

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

simonrozsival and others added 7 commits February 20, 2026 16:12
Add IntegrationTests and UserTypesFixture projects to Xamarin.Android.sln.
Add CI step to run integration tests and publish results. Add
InternalsVisibleTo for the integration test assembly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove test logging/noise, extract reusable helpers, and split long comparison flows into focused helper methods.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract list-diff logic from [Fact] methods into ComparisonDiffHelper and remove section-divider comments from UserTypes fixture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ScannerRunner.cs: TypeMapEntry/MethodEntry/TypeMethodGroup records + scanner logic
- TypeDataBuilder.cs: TypeComparisonData record + Cecil/peer type data builders
- MarshalMethodDiffHelper.cs: marshal method comparison logic
- ComparisonDiffHelper.cs: per-field type comparison helpers
- ScannerComparisonTests.Helpers.cs: partial class with assertion helpers + assembly path properties
- ScannerComparisonTests.cs: now contains only [Fact] methods

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers

Copy link
Copy Markdown
Member

This one fails to build with:

(CoreCompile target) -> 
         /Users/runner/work/1/s/android/tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/ScannerComparisonTests.Helpers.cs(138,3): error xUnit2020: Do not use Assert.True(false, message) to fail a test. Use Assert.Fail(message) instead. (https://xunit.net/xunit.analyzers/rules/xUnit2020) [/Users/runner/work/1/s/android/tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests.csproj]

    296 Warning(s)
    1 Error(s)

jonathanpeppers and others added 3 commits March 4, 2026 12:24
…se, ...)

Replace Assert.True(false, message) with Assert.Fail(message) to satisfy
the xUnit2020 analyzer rule.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival

Copy link
Copy Markdown
Member Author

/azp run Xamarin.Android-PR

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@jonathanpeppers
jonathanpeppers merged commit 0a2edb0 into dotnet:main Mar 10, 2026
36 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Area: CoreCLR Issues that only occur when using CoreCLR. Area: NativeAOT Issues that only occur when using NativeAOT. 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.

3 participants