Skip to content

[TrimmableTypeMap] Assert build test outputs#11485

Merged
jonathanpeppers merged 1 commit into
mainfrom
dev/simonrozsival/11020-trimmable-typemap-build-tests
May 26, 2026
Merged

[TrimmableTypeMap] Assert build test outputs#11485
jonathanpeppers merged 1 commit into
mainfrom
dev/simonrozsival/11020-trimmable-typemap-build-tests

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

@simonrozsival simonrozsival commented May 25, 2026

Summary:

  • assert the trimmable typemap build tests generate the root and Mono.Android typemap DLLs
  • assert generated JCW Java sources exist under the typemap output directory

Validation:

  • make all CONFIGURATION=Debug
  • MSBUILDDISABLENODEREUSE=1 ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "FullyQualifiedName~Build_WithTrimmableTypeMap_Succeeds|FullyQualifiedName~Build_WithTrimmableTypeMap_IncrementalBuild"

Closes #11020

Closes #11020

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 14:34
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

Updates the trimmable typemap end-to-end build tests to validate that a successful build produces the expected typemap artifacts and generated JCW Java sources, aligning the tests with the now-complete trimmable build pipeline (issue #11020).

Changes:

  • Replace basic typemap directory existence checks with assertions that the expected typemap DLL outputs are generated.
  • Add a shared helper to assert presence of the root typemap DLL, Mono.Android typemap DLL, and at least one generated .java file under the typemap output.

@simonrozsival simonrozsival added copilot `copilot-cli` or other AIs were used to author this trimmable-type-map labels May 25, 2026
@simonrozsival
Copy link
Copy Markdown
Member Author

/review

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label May 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Android PR Reviewer completed successfully!

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ LGTM

Clean extraction of repeated assertions into AssertTrimmableTypeMapOutputs. The new helper validates the typemap DLLs and JCW Java sources — good coverage for #11020.

Summary:

  • 0 ❌ errors · 0 ⚠️ warnings · 1 💡 suggestion
  • GitHub CI checks all green. Xamarin.Android-PR status not verified (no AZDO auth).

Positives:

  • Good use of a shared helper to avoid duplication across two test methods
  • Assertion messages are descriptive and will produce clear failure output
  • Follows repo conventions (tabs, Mono style, BaseTest inheritance)

Generated by Android PR Reviewer for issue #11485 · ● 9.4M

var javaDir = Path.Combine (typemapDir, "java");
DirectoryAssert.Exists (javaDir, "Trimmable JCW Java output directory should exist.");

var javaFiles = Directory.GetFiles (javaDir, "*.java", SearchOption.AllDirectories);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 💡 Testing — Consider asserting the count or a specific expected file name rather than just IsNotEmpty. This would catch regressions where some JCW sources are silently dropped (e.g., if a future change causes only 1 of N expected files to be generated). For example, Assert.That (javaFiles.Length, Is.GreaterThanOrEqualTo (2), ...) or checking that a known type like MainActivity has a corresponding .java file.

Rule: Test assertions must be specific

@jonathanpeppers jonathanpeppers merged commit 83aded7 into main May 26, 2026
7 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/simonrozsival/11020-trimmable-typemap-build-tests branch May 26, 2026 13:12
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 ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TrimmableTypeMap] Update TrimmableTypeMapBuildTests to expect a full successful build

3 participants