Skip to content

Conversation

@PureWeen
Copy link
Member

@PureWeen PureWeen commented Dec 22, 2025

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

Split iOS device tests by category in Helix to work around an unknown issue that causes tests to take over an hour when run together, vs under 15 minutes when split.

Problem

When running all Controls.DeviceTests categories together on iOS in CI, the test run takes over an hour. When the same tests are split by category, they complete in under 15 minutes total. This issue only reproduces in CI - we haven't been able to reproduce it locally. Ideally we'd find and fix the root cause, but until then this workaround keeps CI times reasonable.

Changes

Helix Configuration (eng/helix_xharness.proj)

  • Add ControlsTestCategoriesToSkipForRestOfTests property defining heavy categories to run individually
  • Split Controls.DeviceTests into 4 work items for iOS:
    • 3 heavy categories run separately: CollectionView, Shell, HybridWebView
    • 1 "Other" work item runs all remaining categories
  • Core.DeviceTests runs as a single work item (no splitting)
  • MacCatalyst and Android unchanged

Test Infrastructure (src/Core/tests/DeviceTests.Shared/DeviceTestSharedHelpers.cs)

  • Add support for TestFilter=SkipCategories=X,Y,Z environment variable
  • Allows skipping multiple categories via comma or semicolon-separated list
  • Existing TestFilter=Category=X support unchanged

Documentation (.github/instructions/helix-device-tests.instructions.md)

  • Add Copilot instructions for Helix device test configuration
  • Document category splitting, local execution, and troubleshooting

Result

iOS device tests now run as ~8 parallel work items instead of 5, with the slowest categories isolated. This brings iOS device test time from 1+ hour down to ~15 minutes.

- Add category-based splitting for iOS Controls.DeviceTests and Core.DeviceTests
- Each category runs as a separate Helix work item (~95 total for iOS)
- Uses CustomCommands with --set-env="TestFilter=Category=X" like old cake approach
- MacCatalyst and Android unchanged (still run as single work items per project)
- Keep category lists in sync with TestCategory.cs files
- Only split Controls.DeviceTests (not Core.DeviceTests)
- Only 7 heavy categories run separately: CollectionView, CarouselView, FlyoutPage, Shell, TabbedPage, WebView, HybridWebView
- All other Controls tests run as one 'Other' work item
- Core.DeviceTests runs as single work item
- Reduces iOS work items from ~95 to ~12
- Add SkipCategories environment variable support in DeviceTestSharedHelpers
- SkipCategories takes comma-separated list of categories to skip
- Define ControlsTestCategoriesToSkipForRestOfTests property once, reuse for both splitting and skipping
- Heavy categories run individually: CollectionView, CarouselView, FlyoutPage, Shell, TabbedPage, WebView, HybridWebView
- Add TestFilter=SkipCategories=X,Y,Z support in DeviceTestSharedHelpers
- Define ControlsTestCategoriesToSkipForRestOfTests property for heavy categories
- Heavy categories run individually: CollectionView, CarouselView, FlyoutPage, Shell, TabbedPage, WebView, HybridWebView
- All other Controls tests run in a single 'Other' work item
- Core.DeviceTests runs as single work item (no splitting)
@PureWeen
Copy link
Member Author

/rebase

@PureWeen
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen marked this pull request as ready for review December 22, 2025 23:12
Copilot AI review requested due to automatic review settings December 22, 2025 23:12
Copy link
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

This PR optimizes iOS device test execution on Helix by splitting heavy test categories into separate parallel work items, reducing overall test time. The implementation adds support for skipping multiple test categories and provides comprehensive documentation for Helix device test configuration.

Key Changes

  • Splits iOS Controls.DeviceTests into 8 parallel work items (7 heavy categories + 1 "Other")
  • Adds SkipCategories filter support to enable running all tests except specified categories
  • Introduces detailed Copilot instructions for Helix device test configuration and troubleshooting

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/Core/tests/DeviceTests.Shared/DeviceTestSharedHelpers.cs Adds SkipCategories=X,Y,Z filter support with comma/semicolon-separated category list parsing
eng/helix_xharness.proj Implements iOS-specific category splitting with 7 heavy categories as individual work items and remaining categories in "Other" work item
.github/instructions/helix-device-tests.instructions.md New documentation covering Helix configuration, iOS category splitting, local execution, and troubleshooting guidance

- Filter empty strings from SkipCategories split to handle trailing separators
- Update documentation to reference correct property/ItemGroup names
- Update heavy categories list to match current implementation
@PureWeen
Copy link
Member Author

Currently our DeviceTest runs are taking over an hour and timing out.

This fixes it so they all take under 9 minutes
Merging for now so we aren't exhausting queue's with our iOS Device Tests

@PureWeen PureWeen merged commit e7f8f08 into main Dec 23, 2025
1 of 29 checks passed
@PureWeen PureWeen deleted the split_up_ios_devices_tests branch December 23, 2025 20:46
StephaneDelcroix pushed a commit that referenced this pull request Jan 5, 2026
<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

Split iOS device tests by category in Helix to work around an unknown
issue that causes tests to take over an hour when run together, vs under
15 minutes when split.

## Problem

When running all Controls.DeviceTests categories together on iOS in CI,
the test run takes over an hour. When the same tests are split by
category, they complete in under 15 minutes total. This issue only
reproduces in CI - we haven't been able to reproduce it locally. Ideally
we'd find and fix the root cause, but until then this workaround keeps
CI times reasonable.

## Changes

### Helix Configuration (`eng/helix_xharness.proj`)
- Add `ControlsTestCategoriesToSkipForRestOfTests` property defining
heavy categories to run individually
- Split Controls.DeviceTests into 4 work items for iOS:
- 3 heavy categories run separately: `CollectionView`, `Shell`,
`HybridWebView`
  - 1 "Other" work item runs all remaining categories
- Core.DeviceTests runs as a single work item (no splitting)
- MacCatalyst and Android unchanged

### Test Infrastructure
(`src/Core/tests/DeviceTests.Shared/DeviceTestSharedHelpers.cs`)
- Add support for `TestFilter=SkipCategories=X,Y,Z` environment variable
- Allows skipping multiple categories via comma or semicolon-separated
list
- Existing `TestFilter=Category=X` support unchanged

### Documentation
(`.github/instructions/helix-device-tests.instructions.md`)
- Add Copilot instructions for Helix device test configuration
- Document category splitting, local execution, and troubleshooting

## Result

iOS device tests now run as ~8 parallel work items instead of 5, with
the slowest categories isolated. This brings iOS device test time from
1+ hour down to ~15 minutes.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant