From f95d53480a216543a138630c54f739887db9f53b Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 19 Oct 2023 11:51:06 -0700 Subject: [PATCH] [ci] Add emulator tests on older Android version (#4616) Adds new tasks to run integration tests on legacy Android emulators (API 22, since we don't currently have API 21 emulators available), so that we are getting more complete coverage of our supported OS versions. For now, excludes several plugins with TODOs and issues filed, so that the suite can be brought online in parallel with investigation of those issues. Most of https://github.com/flutter/flutter/issues/130010 --- .ci.yaml | 72 +++++++++++++++++++ .../android_legacy_emulator_tests.yaml | 16 +++++ ...e_integration_android_legacy_emulator.yaml | 13 ++++ 3 files changed, 101 insertions(+) create mode 100644 .ci/targets/android_legacy_emulator_tests.yaml create mode 100644 script/configs/exclude_integration_android_legacy_emulator.yaml diff --git a/.ci.yaml b/.ci.yaml index 921ef16b1a..2e5d15c976 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -29,6 +29,18 @@ platform_properties: {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "curl", "version": "version:7.64.0"} ] + linux_android_legacy: + properties: + os: Ubuntu + cores: "8" + device_type: none + dependencies: >- + [ + {"dependency": "android_sdk", "version": "version:33v6"}, + {"dependency": "open_jdk", "version": "version:17"}, + {"dependency": "curl", "version": "version:7.64.0"}, + {"dependency": "android_virtual_device", "version": "22"} + ] linux_desktop: properties: os: Ubuntu @@ -529,6 +541,66 @@ targets: {"dependency": "android_virtual_device", "version": "33"} ] + - name: linux_android_legacy android_platform_tests_legacy_api_shard_1 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 0 --shardCount 6" + + - name: linux_android_legacy android_platform_tests_legacy_api_shard_2 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 1 --shardCount 6" + + - name: linux_android_legacy android_platform_tests_legacy_api_shard_3 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 2 --shardCount 6" + + - name: linux_android_legacy android_platform_tests_legacy_api_shard_4 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 3 --shardCount 6" + + - name: linux_android_legacy android_platform_tests_legacy_api_shard_5 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 4 --shardCount 6" + + - name: linux_android_legacy android_platform_tests_legacy_api_shard_6 master + recipe: packages/packages + timeout: 60 + bringup: true # New target + properties: + target_file: android_legacy_emulator_tests.yaml + channel: master + version_file: flutter_master.version + package_sharding: "--shardIndex 5 --shardCount 6" + # Device versions of Android integration tests, run via FTL. # TODO(stuartmorgan): Revisit whether physical device tests are redundant once # we have more data about emulator tests; see diff --git a/.ci/targets/android_legacy_emulator_tests.yaml b/.ci/targets/android_legacy_emulator_tests.yaml new file mode 100644 index 0000000000..06160bfbe8 --- /dev/null +++ b/.ci/targets/android_legacy_emulator_tests.yaml @@ -0,0 +1,16 @@ +tasks: + - name: prepare tool + script: .ci/scripts/prepare_tool.sh + infra_step: true # Note infra steps failing prevents "always" from running. + - name: download Dart and Android deps + script: script/tool_runner.sh + infra_step: true + args: ["fetch-deps", "--android", "--supporting-target-platforms-only", "--exclude=script/configs/exclude_integration_android_legacy_emulator.yaml"] + # Only these two tests are run because they are the only ones that use the + # emulator. Other tests would just duplicate android_platform_test.yaml tests. + - name: native integration tests + script: script/tool_runner.sh + args: ["native-test", "--android", "--no-unit", "--exclude=script/configs/exclude_integration_android_legacy_emulator.yaml"] + - name: drive examples + script: script/tool_runner.sh + args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android_legacy_emulator.yaml,script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml"] diff --git a/script/configs/exclude_integration_android_legacy_emulator.yaml b/script/configs/exclude_integration_android_legacy_emulator.yaml new file mode 100644 index 0000000000..9ea107aaf0 --- /dev/null +++ b/script/configs/exclude_integration_android_legacy_emulator.yaml @@ -0,0 +1,13 @@ +# This plugin no-ops below API 25, which is newer than the legacy emulator. +# This can be removed once the legacy emulator test is using at least +# API level 25. +- quick_actions +- quick_actions_android +# Fails on the legacy emulator. See https://github.com/flutter/flutter/issues/136823 +# TODO(stuartmorgan): Remove this if the limitation can be worked around. +- video_player +- video_player_android +# Hangs on the legacy emulator. See https://github.com/flutter/flutter/issues/136824 +# TODO(stuartmorgan): Remove this if the hang can be fixed. +- webview_flutter +- webview_flutter_android