[tests] Move typemap rewrite coverage to net11 - #12732
Closed
simonrozsival wants to merge 1 commit into
Closed
Conversation
Move the cross-component generated typemap rewrite tests out of the net10 Build.Tests project now that the typemap generator targets net11. Keep the same assertions in the existing net11 integration test project, which references both components directly. Fixes the solution compilation regression introduced by #12631. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new integration test file is missing a required using Microsoft.Android.Sdk.TrimmableTypeMap; import for referenced typemap generator types, which will break compilation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/JniAssemblyRewriterIntegrationTests.cs — ❌ error: This test file uses TypeMapAssemblyGenerator/JavaPeerInfo/etc. but does not import the… |
What changed in this PR
This PR moves the end-to-end typemap generation + JNI assembly rewriting coverage into the Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests project so the tests can target a compatible framework after Microsoft.Android.Sdk.TrimmableTypeMap moved to .NET 11, while keeping pure JNI rewriter coverage in Xamarin.Android.Build.Tests.
Changes:
- Added xUnit integration tests that generate a typemap assembly and validate
JniAssemblyRewriteroutput against R8 mappings. - Updated the integration-test
MockBuildEngineto record warnings emitted viaTaskLoggingHelper. - Removed the typemap-generation-based rewrite tests from the existing NUnit
JniAssemblyRewriterTestssuite (leaving the rest of the rewriter tests in place).
| File | Description |
|---|---|
| tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/MockBuildEngine.cs | Captures warning events so integration tests can assert on emitted XA codes. |
| tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/JniAssemblyRewriterIntegrationTests.cs | New integration coverage combining typemap generation and JNI rewrite verification on a net11-compatible test project. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/JniRemapping/JniAssemblyRewriterTests.cs | Removes typemap-generation-dependent rewrite tests from NUnit suite to avoid incompatible references. |
Comment on lines
+1
to
+10
| using System; | ||
| using System.Collections.Immutable; | ||
| using System.IO; | ||
| using System.Linq; | ||
| using System.Reflection.Metadata; | ||
| using System.Reflection.PortableExecutable; | ||
| using Microsoft.Build.Utilities; | ||
| using Xunit; | ||
| using Xamarin.Android.Tasks.JniRemapping; | ||
|
|
Member
Author
|
Duplicate of #12736 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the compilation regression introduced by #12631 after
Microsoft.Android.Sdk.TrimmableTypeMapmoved to .NET 11.The two tests that exercise both typemap generation and JNI assembly rewriting now live in
Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests, which directly references both components at a compatible target framework. Pure JNI rewriter coverage remains inXamarin.Android.Build.Tests.This unblocks the affected flaky-CI PR builds without changing product behavior.