[TrimmableTypeMap] Assert build test outputs#11485
Conversation
Closes #11020 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
typemapdirectory 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
.javafile under the typemap output.
|
/review |
|
✅ Android PR Reviewer completed successfully! |
There was a problem hiding this comment.
✅ 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-PRstatus 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,
BaseTestinheritance)
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); |
There was a problem hiding this comment.
🤖 💡 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
Summary:
Validation:
make all CONFIGURATION=DebugMSBUILDDISABLENODEREUSE=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