Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Mar 29, 2022

Currently, we need all Android SDK platforms to perform the api-merge needed to build Xamarin.Android. However, we do not need all of them on the test agents in order to run our tests.

Add an option to xaprepare called --android-sdk-platforms that can be used to specify which API levels are needed.

For test agents, request API levels 19,21,26,32 needed for tests to successfully run. This cuts the time taken for the xaprepare step on a fresh Windows VM image from 19m:36s to 5m:11s.

A future enhancement would be to examine the tests that require API levels 19/21/26 to determine if these tests actually need to run against those levels, or if they could be updated to use the latest level.

Tests requiring old API levels:
26 - CheckMaxResWarningIsEmittedAsAWarning
21 - FailedBuildFew_ConflictingTextView, FailedBuildMany_ConflictingLinearLayout, SuccessfulBuildFew_DTB, etc.
19 - CheckTargetFrameworkVersion

@jpobst jpobst force-pushed the selective-platforms branch from 757ad50 to 92d73e6 Compare March 29, 2022 18:19
@jpobst jpobst force-pushed the selective-platforms branch from 92d73e6 to 1713414 Compare March 29, 2022 21:11
@jpobst jpobst marked this pull request as ready for review March 30, 2022 14:45
@jpobst jpobst requested review from grendello, jonathanpeppers, jonpryor and pjcollins and removed request for grendello, jonpryor and pjcollins March 30, 2022 14:45
Copy link
Member

@pjcollins pjcollins left a comment

Choose a reason for hiding this comment

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

The AndroidToolchainComponentType.BuildDependency flag could also be used here, if it is added to the API levels that aren't required by tests the AndroidTestDependencies scenario would skip them by default. The new argument that lets you select specific versions for any xaprepare scenario also seems like a good addition.

@jonpryor jonpryor merged commit 83dfd15 into main Apr 1, 2022
@jonpryor jonpryor deleted the selective-platforms branch April 1, 2022 18:45
jpobst added a commit that referenced this pull request Mar 13, 2023
[Previously](#6874), we reduced the number of Android SDK Platforms that needed to be installed on CI test agents to `19,21,26,32,33`.  This can significantly reduce the amount of time needed to `xaprepare` an agent.

With most uses of Classic gone from `main`, retesting this reveals more platforms that can be removed.

Removing `19,21,26,32` saves up to 2 minutes of `xaprepare` time, particularly on Windows.

Note: API 27+ should be already installed on our images:
- [Mac preinstalled software](https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#android)
- [Windows preinstalled software](https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#android)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
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.

6 participants