Conversation
There was a problem hiding this comment.
Pull request overview
Updates the CI pipeline to run Android tests on a Linux-based pool (MAUI-DNCENG with 1ESPT-Ubuntu22.04) instead of macOS pools.
Changes:
- Added a new
AndroidPoolLinuxpipeline parameter describing the Linux pool + demands. - Updated the
mac_runandroid_testsstage to useAndroidPoolLinuxfor both PR and non-PR runs.
| @@ -277,12 +284,9 @@ stages: | |||
| # TODO: macOSTemplates and AOT template categories | |||
| - name: mac_runandroid_tests | |||
There was a problem hiding this comment.
The stage name mac_runandroid_tests is now misleading since it runs on a Linux pool. Consider renaming it to something platform-neutral (e.g., runandroid_tests) or explicitly Linux-based (e.g., linux_runandroid_tests) to avoid confusion when diagnosing CI failures.
| - name: mac_runandroid_tests | |
| - name: linux_runandroid_tests |
|
@copilot can you figure how we can install maui-android instead of maui when running mac_runandroid_tests since this a linux ? i think uitests do this , can you saw how it is done on those pipelines? |
🤖 AI Summary📊 Expand Full Review🔍 Pre-Flight — Context & Validation📝 Review Session — [ci] Run android on MAUI-Dnceng ·
|
| File:Line | Reviewer Says | Author Says | Status |
|---|---|---|---|
| ci.yml:285 | Stage name mac_runandroid_tests is misleading for Linux; suggest linux_runandroid_tests |
N/ VALID CONCERN | A |
| ci.yml:289 | if/else conditional is redundant (both branches same pool) | "We have the same pool shared between internal and public so this should NEEDS SIMPLIFICATION | work" |
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #33997 | Move RunOnAndroid to Linux pool, add AndroidPoolLinux PENDING (Gate) | eng/pipelines/ci.yml (+9, -5) |
Known failing state; follow-up PR #34046 fixes workload issue | parameter |
Context from Discussion
- Author noted the PR fails due to workload installation issues on Linux
- Author asked Copilot about how to install
maui-androidinstead ofmauion Linux - A Copilot coding agent opened PR [ci] Enable Linux Android integration tests with workload and KVM support #34046 to fix this with: conditional
maui-androidworkload on Linux + KVM enablement in setup-test-env.yml - PR [ci] Run android on MAUI-Dnceng #33997 is an infrastructure-only change - no functional code or test changes
🚦 Gate — Test Verification
📝 Review Session — [ci] Run android on MAUI-Dnceng · 0439209
** SKIPPED (CI-Only PR)Result:**
Platform: N/A
Mode: N/A
Reason for Skip
This PR is a CI pipeline infrastructure change only (eng/pipelines/ci.yml). There are no unit tests or UI tests that can validate CI YAML configurations.
The RunOnAndroid integration tests exist (AndroidTemplateTests.RunOnAndroid) but:
- They require a full CI pipeline environment with Android emulator
- They cannot be run locally with
BuildAndRunHostApp.ps1orverify-tests-fail-without-fix - They don't test the correctness of the CI YAML itself
Known CI Status
The PR author explicitly acknowledged the build is failing:
- Build failure: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1290026
- Failure reason:
mauiworkload cannot be installed on Linux (requires iOS/macOS dependencies) - Follow-up PR [ci] Enable Linux Android integration tests with workload and KVM support #34046 was created to fix this issue
Assessment
Gate is not applicable for CI-only pipeline changes. The correctness of this PR must be assessed through code review of the YAML changes and the known CI failure evidence.
🔧 Fix — Analysis & Comparison
📝 Review Session — [ci] Run android on MAUI-Dnceng · 0439209
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #33997 | Move RunOnAndroid to Linux pool ( FAILING (Known) | eng/pipelines/ci.yml (+9, -5) |
CI-only change; known failing due to workload install issue | AndroidPoolLinux) |
Notes on Try-Fix Phase
try-fix was SKIPPED for this PR because:
-
No testable fix exists - This is a CI pipeline YAML change, not a code fix. The
try-fixskill requires a test command (e.g.,BuildAndRunHostApp.ps1) that validates the fix, which doesn't apply to CI YAML changes. -
Gate was not applicable - Without Gate passing, try-fix cannot run (Gate is a prerequisite).
-
CI-only changes require CI environment to validate - The RunOnAndroid integration tests require a full CI pipeline with Android emulator; they cannot be run locally.
Exhausted: N/A (skipped - CI-only PR)
Selected Fix: PR's fix (with companion PR #34046 required to complete the work)
📋 Report — Final Recommendation
📝 Review Session — [ci] Run android on MAUI-Dnceng · 0439209
Final Recommendation: REQUEST CHANGES##
Summary
PR #33997 moves the mac_runandroid_tests integration test stage from macOS pools to a Linux pool (MAUI-DNCENG with 1ESPT-Ubuntu22.04). The motivation is Android tests don't need macOS but the PR is currently failing in CI due to two issues that must be addressed before merging.infrastructure valid
Root Cause of CI Failures
The PR's change requires two additional fixes to work correctly on Linux:
-
Workload installation failure:
setup-test-env.ymlinstalls the fullmauiworkload (viaDotNet.csproj -t:Install), which on Linux attempts to install iOS/macOS/tvos workloads. These are unavailable on Linux and cause installation failures. The fix is to usemaui-androidworkload on Linux instead. -
KVM not enabled: Android emulators require KVM (Kernel Virtual Machine) on Linux. The
setup-test-env.ymldoesn't enable KVM on Linux, causing emulator failures. The fix is to add audevrules step conditioned on Linux.
Fix Quality Assessment
The PR's core approach (using Linux for Android tests) is architecturally sound and aligned with the existing pattern used in UI tests (eng/pipelines/common/ui-tests.yml already uses androidLinuxPool for Android UI tests). However, the PR is incomplete without the companion fixes in PR #34046.
PR #34046 provides the necessary companion fixes:
src/DotNet/DotNet.csproj: Installmaui-androidon Linux,mauielsewhereeng/pipelines/arcade/setup-test-env.yml: Enable KVM on Linux agents
Code Quality Issues Found
-
Redundant conditional (confirmed by author): The
if/elseblock inci.ymllines 287-290 has the same pool for both branches. This should be simplified:# Current (redundant) ${{ if eq(variables['Build.DefinitionName'], 'maui-pr') }}: pool: ${{ parameters.AndroidPoolLinux }} ${{ else }}: pool: ${{ parameters.AndroidPoolLinux }} # Simplified pool: ${{ parameters.AndroidPoolLinux }}
-
Misleading stage name:
mac_runandroid_testsstill says "mac" but now runs on Linux. While this could be renamed (tolinux_runandroid_tests), the author didn't engage with this suggestion, and renaming could cause issues with existing pipeline references. This is a minor concern.
Recommendations
- Merge PR [ci] Enable Linux Android integration tests with workload and KVM support #34046 first (or incorporate its changes into this the workload install and KVM fixes are required for this change to functionPR)
- Simplify the redundant
if/elseboth branches set the same poolconditional - Consider addressing the stage name to avoid operational confusion
Status Summary
| Phase | Status |
|---|---|
| Pre-Flight COMPLETE | |
| SKIPPED (CI-only PR, no unit/UI tests applicable) | Gate |
| Fix (try- SKIPPED (CI-only PR) | fix) |
| Report COMPLETE |
📋 Expand PR Finalization Review
Title: ✅ Good
Current: [ci] Run android on MAUI-Dnceng
Description: ⚠️ Needs Update
Description needs updates. See details below.
✨ Suggested PR Description
[!NOTE]
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Moves the mac_runandroid_tests stage (RunOnAndroid integration tests) from macOS-based pools to a Linux-based pool (MAUI-DNCENG with 1ESPT-Ubuntu22.04).
Motivation: Android tests do not require macOS infrastructure. Using Linux agents is faster, more cost-effective, and consistent with the existing pattern already used for Android UI tests in eng/pipelines/common/ui-tests.yml (which uses androidLinuxPool).
Pipeline configuration updates:
- Added a new
AndroidPoolLinuxparameter specifying theMAUI-DNCENGpool with1ESPT-Ubuntu22.04image. - Updated the
mac_runandroid_testsstage to useAndroidPoolLinuxfor both PR (maui-pr) and non-PR CI runs, replacing:- PR runs: was
AcesShared/ACES_arm64_Sequoia_Xcode - Non-PR runs: was
MacOSPool.internal
- PR runs: was
⚠️ Note: This PR requires companion PR #34046 to work correctly on Linux. That PR fixes:
- Workload installation: uses
maui-androidinstead ofmauion Linux (avoids iOS/macOS/tvOS dependency failures)- KVM enablement: adds udev rules for Android emulator hardware acceleration on Linux agents
Issues Fixed
N/A (CI infrastructure improvement)
Code Review: ⚠️ Issues Found
Code Review — PR #33997
File: eng/pipelines/ci.yml (+9/-5)
🔴 Critical Issues
PR Is Currently Failing in CI
Problem: The PR author confirmed that the CI build fails with this change because the setup-test-env.yml installs the full maui workload (DotNet.csproj -t:Install), which on Linux attempts to install iOS/macOS/tvOS workloads. These are unavailable on Linux and cause installation failures.
Evidence: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1290026
Required companion fixes (PR #34046):
src/DotNet/DotNet.csproj— Installmaui-androidworkload on Linux,mauielsewhereeng/pipelines/arcade/setup-test-env.yml— Enable KVM (Kernel Virtual Machine) for Android emulator hardware acceleration on Linux agents
Recommendation: Merge PR #34046 first (or incorporate its changes into this PR) before this PR can be merged.
🟡 Suggestions
1. Redundant if/else Conditional
File: eng/pipelines/ci.yml, lines 287–292
Problem: The if/else block that was previously needed to distinguish between maui-pr pipeline (macOS arm64 pool) and non-PR CI (MacOSPool.internal) now sets the same pool (${{ parameters.AndroidPoolLinux }}) in both branches. This is redundant and adds unnecessary noise.
# Current (redundant — both branches identical)
${{ if eq(variables['Build.DefinitionName'], 'maui-pr') }}:
pool: ${{ parameters.AndroidPoolLinux }}
${{ else }}:
pool: ${{ parameters.AndroidPoolLinux }}Author's response: "We have the same pool shared between internal and public so this should work."
Assessment: The author's comment explains why both pools are the same (intentional), but the redundant conditional still adds unnecessary noise and should be simplified.
Recommendation:
# Simplified
pool: ${{ parameters.AndroidPoolLinux }}Note: A reviewer from Copilot raised this and the thread was marked resolved, but the code was not changed. The simplification is still worth applying.
2. Misleading Stage Name
File: eng/pipelines/ci.yml, line 285
Problem: The stage is named mac_runandroid_tests but now runs on a Linux pool. This will cause confusion when:
- Diagnosing CI failures (developers will look for macOS-related issues)
- Reading pipeline logs and reports
- Future maintenance of this file
Reviewer suggestion (unresolved thread):
# Suggested (from Copilot reviewer)
- name: linux_runandroid_testsAlternative: runandroid_tests (platform-neutral) to avoid future churn if pool changes again.
Note: Renaming could affect any external pipeline references or dashboards that filter by stage name. The author did not respond to this suggestion, so the risk tradeoff should be evaluated by the team.
✅ Looks Good
AndroidPoolLinuxparameter structure matches the existing pattern used byMacOSPool,AndroidPool, etc. in the same file — well-formed YAML with propername/demandsstructure.- Architectural direction is sound — moving Android tests to Linux is consistent with the existing
androidLinuxPoolalready used ineng/pipelines/common/ui-tests.ymlfor Android UI tests. This is the right long-term direction. - Both PR and non-PR paths updated — the change correctly handles both
maui-prand non-PR CI runs.
|
@copilot when installing "Install dotnet preview workloads from PackageArtifacts" we should check if we are on linux if so we just install maui-android can you work on that ? |
…port (#34046) The `mac_runandroid_tests` stage was moved to Linux pools but failed due to two issues: workload installation attempted to install the full `maui` workload (which includes iOS/macOS dependencies unavailable on Linux), and KVM was not enabled for Android emulator support. **Changes:** - Modified `src/DotNet/DotNet.csproj` `Install` target to conditionally install `maui-android` on Linux, `maui` on other platforms - Aligns with existing pattern in `_InstallWorkloadPacks` target where iOS/macOS workloads are excluded on Linux - Added KVM enablement step to `eng/pipelines/arcade/setup-test-env.yml` for Android integration tests on Linux - Creates udev rules to allow KVM access for Android emulators - Matches pattern used in `device-tests-steps.yml` and `ui-tests-steps.yml` ```xml <ItemGroup> <!-- On Linux, install maui-android instead of maui to avoid iOS/macOS dependencies --> <_LocalWorkloadIds Include="maui-android" Condition="$([MSBuild]::IsOSPlatform('linux'))" /> <_LocalWorkloadIds Include="maui" Condition="!$([MSBuild]::IsOSPlatform('linux'))" /> </ItemGroup> ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This adds a 3rd identical copy of the KVM enablement block (the same 3 lines already exist in |
Move the duplicated KVM enablement block into eng/pipelines/common/enable-kvm.yml and reference it from setup-test-env.yml, ui-tests-steps.yml, and device-tests-steps.yml. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run maui-pr-devicetests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run maui-pr-uitests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/backport to release/11.0.1xx-preview2 |
|
Started backporting to |
### Description of Change This pull request updates the CI pipeline configuration to introduce and use a new Linux-based pool for running Android tests, replacing the previous macOS-based pools. The main changes are the addition of the `AndroidPoolLinux` parameter and updating the relevant test stage to use this new pool. **Pipeline configuration updates:** * Added a new `AndroidPoolLinux` parameter to `parameters:` in `eng/pipelines/ci.yml` for specifying a Linux pool (`MAUI-DNCENG`) with the `1ESPT-Ubuntu22.04` image for Android test runs. * Updated the `mac_runandroid_tests` stage to use the new `AndroidPoolLinux` pool instead of the previous macOS-based pools, ensuring Android tests run on Linux infrastructure. --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description of Change
This pull request updates the CI pipeline configuration to introduce and use a new Linux-based pool for running Android tests, replacing the previous macOS-based pools. The main changes are the addition of the
AndroidPoolLinuxparameter and updating the relevant test stage to use this new pool.Pipeline configuration updates:
AndroidPoolLinuxparameter toparameters:ineng/pipelines/ci.ymlfor specifying a Linux pool (MAUI-DNCENG) with the1ESPT-Ubuntu22.04image for Android test runs.mac_runandroid_testsstage to use the newAndroidPoolLinuxpool instead of the previous macOS-based pools, ensuring Android tests run on Linux infrastructure.