Repository navigation
[tests] Remove duplicate integration builds and one CI lane - #13390
Merged
Merged
Conversation
Consolidate BundleTool artifact checks per runtime so CI slicing cannot repeat their project builds. Move command-only checks to host tests, remove covered integration cases, and reduce emulator lanes to eleven. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The public and internal CI entrypoints still define jobs inline with parallel: 12, so changing the shared template does not make those pipelines exercise the intended 11-agent experiment.
1 open issue
What changed in this PR
This PR reduces redundant .NET for Android integration-test builds and consolidates BundleTool coverage without changing production code. It also changes the shared emulator-stage template’s default agent count as an experiment in reducing CI resource use.
Changes:
- Remove duplicate test cases and move unique assertions into retained tests.
- Consolidate BundleTool artifact checks into one build-backed case per runtime; move command-line checks to host-side tests.
- Change the emulator template default from 12 agents to 11 and update the test catalog.
| File | Description |
|---|---|
tests/MSBuildDeviceIntegration/Tests/FastDevTest.cs |
Remove the duplicate install/uninstall smoke test. |
tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs |
Consolidate artifact and installation checks into one case per runtime. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs |
Remove redundant obsolete-property build variants. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/BundleToolTaskTests.cs |
Add host-side BundleTool command-line tests. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs |
Remove duplicate space-name cases and relocate the packaged DEX assertion. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs |
Remove overlay coverage duplicated by the incremental test. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs |
Remove duplicate validation and obsolete-property cases. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest3.cs |
Remove duplicate native-library preload exclusion coverage. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs |
Move the duplicate-entry warning assertion into the retained multidex test. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs |
Remove one overlapping CoreCLR special-character case. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs |
Retain F# designer tests while removing overlapping C# cases. |
build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml |
Lower the template’s default agent count to 11. |
.github/skills/tests/references/test-catalog.md |
Document host-side command tests and consolidated device coverage. |
Review effort: Balanced
Use one compile-time variable for the public and internal inline jobs and the shared stage template. This makes the eleven-agent reduction apply to PR validation as well as the templated pipeline. Co-authored-by: Copilot App <[email protected]>
simonrozsival
approved these changes
Nov 4, 2026
9 tasks
jonathanpeppers
added a commit
that referenced
this pull request
Nov 10, 2026
The internal main pipeline rejects an empty parallel count after #13390. Restore the stage parameter and pass the shared 11-agent setting from its caller, where the variable is available during template expansion. Co-authored-by: Copilot App <[email protected]>
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.

Remove duplicate project builds without pruning distinct runtime, language, Unicode-space, or packaging scenarios. Consolidate BundleTool's repeated setup and reduce the MSBuild+Emulator pool from 12 agents to 11. No production code changes.
The public and internal inline jobs and the shared stage template now all read the single
MSBuildEmulatorTestAgentCountsetting inyaml-templates/variables.yaml.First PR CI results — November 4
Build 1663708 tested merge commit
2ccc975e, which includes PR head24cc6034and the shared 11-agent setting. Azure actually scheduled 11 emulator jobs.The completed lanes support the direction of the savings estimate, but this is not yet a complete before/after performance result: ten lanes completed successfully; one hosted agent disconnected during toolchain setup before it could run any tests.
Run teststasksThe completed-lane mean is about 25% lower than the median historical per-lane mean (39.5 vs. 52.6 minutes), despite scheduling more cases per lane after reducing the agent count. This is a descriptive comparison of completed lanes, not a measured 25% reduction in total workload or whole-pipeline elapsed time. The missing lane has different tests; dividing its partial 394.5-minute total by a complete historical total would overstate savings. All recorded primary-task work, including failed first test attempts, remains in the table.
Both consolidated BundleTool runtime cases passed on their first attempt, including their builds and install/archive assertions: CoreCLR 6m35s; NativeAOT 8m37s. Only these two BundleTool cases were published, versus 28 fixture setup executions in each historical sample. Of 250 scheduled cases, the ten reporting lanes published 227 final results: 199 passed and 28 skipped/not executed. Lane 6's 23 cases remain unvalidated by this run.
Per-lane primary test-task times
Run testselapsedRetry task time is additional to the primary times above. Azure reports 84.7 minutes for the emulator stage, versus 84.6–126.7 minutes in the historical samples, but the failed/incomplete stage is not a clean successful stage-latency measurement.
Why CI is red, and relevance to this PR
The sole gating root failure is hosted-agent infrastructure loss, not a test assertion or a lane exceeding its 180-minute timeout:
Lane 6's setup log stops during
install OpenJDK and accept Android SDK licenses, while downloading the Android emulator archive. Emulator startup, slicing,Run tests, and result publishing were abandoned. This occurred before the modified tests ran; there is no evidence linking it to test consolidation or the 11-lane shard size. The build remains red, rather than being described as passing despite infrastructure failure.Two unchanged device tests failed their first attempt and passed the pipeline's existing automatic retry without a code change:
InstallAndRunTests.InterfaceMethods_CoreCLR_Native_R8andNativeLibraryLoadTests.AssemblyStoreDlopenResolvesOriginalPayload(True,True). The latter consumed 10m43s on its failed first attempt and contributes to lane 8's long tail. Neither consolidated BundleTool case needed a retry. The public Windows and Linux test stages passed.Conclusion: the observed completed-lane runtimes are consistent with retaining one fewer agent, and the intended BundleTool build deduplication is confirmed. The original 10–15% aggregate-work estimate remains an estimate until the missing emulator job completes in a clean retry/run. A targeted retry of failed jobs in
msbuilddevice_testswould complete the evidence; no retry was initiated as part of this investigation.Tests removed or reduced, and retained coverage
Test names below are in
Xamarin.Android.Build.Tests.BuildTest3.NativeLibraryJniPreload_AddSomeCustomLibrariesAndIgnoreAllByName()NativeLibraryJniPreload_ExcludeAllCustomLibraries()already adds two custom native libraries, excludes each by name, and verifies that the default preload libraries remain.PackagingTest.CheckProjectWithSpaceInNameWorks("Test Me", runtime)"TestUnicodeSpace0020\u0020Me"case also contains an ordinary U+0020 space. Keep that case for both runtimes, along with every distinct Unicode-space case.PackagingTest.CheckClassesDexIsIncluded()classes.dex. Move that exact assertion into the existing ReleaseCheckIncludedNativeLibraries()builds, retaining both runtimes and compression settings. The multidex tests also retain their packaged DEX checks.BuildTest2.BuildMultiDexApplication()BuildAfterMultiDexIsNotRequired()builds the same large multidex project and checks both intermediate and packaged DEX files, before testing the transition back to a single DEX. Move the unique no-Duplicate zip entrywarning assertion into that retained first build.FastDevTest.SimpleInstallAndUninstall()InstallTests.InstallAndUnInstall()already builds, installs, verifies the package and fast-deployment contents, uninstalls, and verifies removal. Keep its Debug and Release cases.ManifestTest.OverlayManifestTest()OverlayManifestIncrementalBuildTest()already performs the initial build with the same CAMERA-permission overlay and checks the merged manifest. It additionally checks no-op target skipping and re-merging after an overlay edit. Keep both runtimes.AndroidUpdateResourcesTest.CheckResourceDesignerIsCreated()CheckOldResourceDesignerIsNotUsed()checks the same intermediate designer creation and removal by Clean, plus the old source designer's contents, for the corresponding C# configurations. Keep all F# cases inCheckResourceDesignerIsCreated().TrimmableTypeMapBuildTests.Build_WithTrimmableTypeMap_Succeeds()$(AndroidTypeMapImplementation), so the five values produce the same integration scenario. Keep one full build for each supported runtime/configuration. Existing standaloneTypeMapProguardTargetsTests.AssemblyTargetConsumesLinkedMetadataAcrossRidsAndEmptyStubs()still exercises all five obsolete values against the production targets.InvalidConfigTests.LibraryBuildDoesNotGenerateTypeMap()BuildTest.SmokeTestBuildWithSpecialCharacters(false, CoreCLR)ApplicationBuildTests.BuildApplicationWithSpecialCharactersInProject("テスト", true)builds the same basic CoreCLR Release project with a Japanese project name/path. Keep the other runtime/Forms smoke cases and all distinct project names.InvalidConfigTests.R8ObfuscationInvalidConfiguration("AndroidLinkTool", "", "AndroidLinkTool")attribute[TestCase]attributes exercised the exact same validation target and assertions. Keep one.BundleToolTests(usesAssemblyBlobs: false, runtime)fixtures.bloband.dllextension checks.BundleTool consolidation: preserve assertions, eliminate repeated setup
The existing fixture had seven test methods and four parameter combinations. In each sampled CI run, each fixture appeared on seven different slices, executing its
[OneTimeSetUp]28 times. Every setup built a localization library and a multi-ABI Forms Maps app: 56 initial project builds.BuildAppBundleCommand(),BuildApkSetCommand(), andInstallApkSetCommand()into host-sideBundleToolTaskTests. These assertions do not depend on fixture parameters, generated projects, or a device; run each once without a building fixture.BaseZip(),AppBundle(),AppBundleSigned(), andApkSet()assertions into oneBundleArtifacts()case per runtime. Keep archive contents, signing, ABI splits, disabled language splitting, compression, and installation checks.This changes 28 setup executions to two, or 56 initial library/application builds to four, regardless of which CI slices receive the two retained cases. This is build deduplication, not deletion of the artifact/install assertions.
Original estimate and why remove one lane
Original estimate: roughly 10–15% less aggregate MSBuild+Emulator test-task time. This is not a measured reduction in whole-pipeline turnaround time; see the incomplete first-run results above.
The investigation used three successful pipelines and their published per-test timestamps/durations:
Run testsminutes, summed over 12 agentsBundleTool-associated pre-test gaps totaled 197–223 aggregate minutes per pipeline, but counting all of that as savings would overstate the evidence. The model excludes every first-in-run gap, uses the observed non-first BundleTool fixture gaps, and subtracts a retained-setup budget using the largest observed cold-start gap for each runtime. The estimates above do not add the separately identified test-body savings.
Dropping one of 12 agents removes 8.3% of parallel capacity. The estimated 10–15% workload reduction provides a rationale for trying 11 agents rather than keeping the redundant builds and their agent cost. The host-test removals are additional savings; they are not used to justify reducing the separate emulator pool.
The CI-pinned
dotnet-test-slicer(0.1.0-alpha7) was run locally with the actual CI category filter for all 11 slices. All 250 discovered cases occur exactly once, with 22–23 cases per slice. The two retained BundleTool runtime cases land on separate agents (3 and 4).A complete successful emulator run is still needed to confirm elapsed time and slice balance. Count-based slicing is not duration balancing. Cold restore/download/compiler/device setup can move to other tests, retries vary, four current minor-API cases lack matching historical timings, and preview-API timing comparisons require target-framework-name normalization. This is therefore a validated test consolidation with an evidence-backed lane-count experiment, not a guarantee of unchanged stage latency. There is no valid local before/after speedup measurement: the original-fixture baseline encountered an existing AVD storage failure; the changed tests were subsequently validated on a clean emulator.
Validation
Local validation was on macOS/arm64 using the locally built Release SDK and prepared JDK 25. Device validation used a clean, session-local API 29 arm64 emulator; it was stopped and removed afterward.
make prepare CONFIGURATION=Releasemake leeroy CONFIGURATION=Releasemake all CONFIGURATION=Releasebuilt the solution but could not configure the workload before the extra API-level reference assemblies were built;make leeroycompleted those prerequisites.BundleArtifacts, plus Debug/Release install/uninstall. Bundle cases took approximately 2:07 and 1:50, including their builds.--filter 'FullyQualifiedName~BundleToolTaskTests'host rungit diff --checkFocused test commands
Host integration coverage:
Retained standalone property matrix:
Device coverage (with
ADB_TARGET='-s emulator-5580'andANDROID_SERIAL=emulator-5580):All test commands used
JAVA_HOME=$HOME/android-toolchain/jdk-25andANDROID_HOME=$HOME/android-toolchain/sdk. Host/device test projects were rebuilt in Release after the source edits. Public Windows/Linux CI passed in build 1663708; a complete 12-to-11-lane emulator stage-time comparison remains blocked on the lost-agent job described above.