Skip to content

[Android] Introduces API 34 emulators for subset of tests #4820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
dec3d69
Merge remote-tracking branch 'upstream/main' into camx_occ
camsim99 May 1, 2023
0e0333b
Merge remote-tracking branch 'upstream/main'
camsim99 May 2, 2023
bd7ac99
Merge remote-tracking branch 'upstream/main'
camsim99 May 3, 2023
5c3363b
Merge remote-tracking branch 'upstream/main'
camsim99 May 10, 2023
fed9621
Undo changes
camsim99 May 10, 2023
5aabe34
Merge remote-tracking branch 'upstream/main'
camsim99 May 12, 2023
2b9a352
Merge remote-tracking branch 'upstream/main'
camsim99 May 25, 2023
a1173da
Merge remote-tracking branch 'upstream/main'
camsim99 May 30, 2023
cbc3d6b
Merge remote-tracking branch 'upstream/main'
camsim99 May 30, 2023
cae5a4c
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 1, 2023
72283db
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 5, 2023
166a77c
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 5, 2023
399780e
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 14, 2023
8d5d0e7
Merge remote-tracking branch 'upstream/main'
camsim99 Jun 26, 2023
084d960
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 12, 2023
d2a59ac
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 17, 2023
a1422bf
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 17, 2023
bdd87a6
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 18, 2023
137a28b
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 19, 2023
bc0db5a
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 20, 2023
d04b466
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 21, 2023
a9cfe87
Merge remote-tracking branch 'upstream/main'
camsim99 Jul 24, 2023
a32def1
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 2, 2023
4785148
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 14, 2023
7a8fc69
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 15, 2023
b02e15f
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 15, 2023
c6e5868
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 17, 2023
0c0065a
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 28, 2023
9dfe259
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 29, 2023
bfcc0df
Merge remote-tracking branch 'upstream/main'
camsim99 Aug 30, 2023
7ee21ea
Bump tests to 34
camsim99 Aug 30, 2023
cc2957d
Bump linux android
camsim99 Aug 31, 2023
0026d0e
Try filtering packages
camsim99 Sep 13, 2023
0bc3706
Merge remote-tracking branch 'upstream/main' into test_34_1
camsim99 Sep 13, 2023
791dd78
Add filter script
camsim99 Sep 13, 2023
c687491
Add quick actions test fix
camsim99 Sep 13, 2023
d91007d
Add 6 back in
camsim99 Sep 13, 2023
4c628c7
Remove quick actions fix attempt, partially address review
camsim99 Sep 14, 2023
83afe66
Correct exclusions/inclusions
camsim99 Sep 14, 2023
89a968a
Remove exlude filter
camsim99 Sep 14, 2023
4430919
Path provider fails with 33, so put back to 34
camsim99 Sep 14, 2023
f39b0b0
Exclude webview
camsim99 Sep 18, 2023
cd977fe
Merge remote-tracking branch 'upstream/main' into test_34_1
camsim99 Sep 18, 2023
70c7aeb
Merge branch 'main' into test_34_1
camsim99 Sep 18, 2023
57117d8
Update still_requires_api_33_avd_drive_examples.yaml
camsim99 Sep 19, 2023
844c8cb
Add new tasks, reduce config files to one
camsim99 Sep 20, 2023
3861779
Merge branch 'test_34_1' of github.com:camsim99/packages into test_34_1
camsim99 Sep 20, 2023
a42b3e6
Fix comments
camsim99 Sep 20, 2023
ea10dde
Mark bringup true
camsim99 Sep 20, 2023
f4b839e
Merge remote-tracking branch 'upstream/main' into test_34_1
camsim99 Sep 26, 2023
685f810
Get rid of duplicate tasks
camsim99 Sep 26, 2023
5272d12
Update exclusions, delte unused files
camsim99 Sep 27, 2023
a764265
Fix integration test, try removing line that may be failing due to pe…
camsim99 Sep 28, 2023
c8883bc
Try using permissions, alternatively
camsim99 Sep 28, 2023
3cfd2b3
Remove experimental changes
camsim99 Oct 9, 2023
106db42
Merge remote-tracking branch 'upstream/main' into test_34_1
camsim99 Oct 9, 2023
7dab380
Undo my changes
camsim99 Oct 9, 2023
378c808
Add audio permission for music
camsim99 Oct 9, 2023
e3229a8
Add permissions and bump version
camsim99 Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ platform_properties:
device_type: none
dependencies: >-
[
{"dependency": "android_sdk", "version": "version:33v6"},
{"dependency": "android_sdk", "version": "version:34v1"},
{"dependency": "open_jdk", "version": "version:17"},
{"dependency": "curl", "version": "version:7.64.0"}
]
Expand Down Expand Up @@ -250,7 +250,7 @@ targets:
# web_benchmarks needs Chrome.
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"},
{"dependency": "android_virtual_device", "version": "34"},
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
{"dependency": "chrome_and_driver", "version": "version:114.0"}
]
Expand All @@ -267,7 +267,7 @@ targets:
# See comments on 'master' version above.
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"},
{"dependency": "android_virtual_device", "version": "34"},
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
{"dependency": "chrome_and_driver", "version": "version:114.0"}
]
Expand Down Expand Up @@ -302,17 +302,20 @@ targets:
{"dependency": "open_jdk", "version": "version:11"}
]

# All of the Linux_android android_platform_tests shards have the same
# dependency list, despite some running on Android 33 AVDs versus 34.
- name: Linux_android android_platform_tests_shard_1 master
recipe: packages/packages
timeout: 60
properties:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 0 --shardCount 6"
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to changed the shard flags (the names of the tasks will be slightly confusing during the transition, but changing names is a huge pain with LUCI), so that each of the two partitions has their own shards, otherwise we may end up with a plugin assigned to a specific shard, but then excluded in that shard (since sharding is pre-exclusion, for slightly complicated reasons).

So I believe the setup we need is something like:

- name: ..._shard_1
  // set up for 34
  package_sharding: "--shardIndex 0 --shardCount 4"

- name: ..._shard_2
  // set up for 34
  package_sharding: "--shardIndex 1 --shardCount 4"

- name: ..._shard_3
  // set up for 34
  package_sharding: "--shardIndex 2 --shardCount 4"

- name: ..._shard_4
  // set up for 34
  package_sharding: "--shardIndex 3 --shardCount 4"

- name: ..._shard_5
  // set up for 33
  package_sharding: "--shardIndex 0 --shardCount 1"

- name: ..._shard_6
  // set up for 33
  package_sharding: "--shardIndex 1 --shardCount 2"

Copy link
Contributor

Choose a reason for hiding this comment

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

The other option we could consider if we think we'll be in this state for a while is to bring up a new task or two for 33 tests, and leave the existing 6 shards as-is but with 34, so the names make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to be actively working on getting the tests failing on 34 working, but two of the failures have been really tricky, so could be a matter of months worst case. I'll start changing the shard flags but let me know if you think it makes more sense to add new tasks instead given that projection.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think on a potential timeline of months it's probably better to bring up 1-2 new shards for 33.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok hoping to be faster but I think that's probably safest.

dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_2 master
Expand All @@ -322,10 +325,11 @@ targets:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 1 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_3 master
Expand All @@ -335,10 +339,11 @@ targets:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 2 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_4 master
Expand All @@ -348,10 +353,11 @@ targets:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 3 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_5 master
Expand All @@ -361,10 +367,11 @@ targets:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 4 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_6 master
Expand All @@ -374,10 +381,11 @@ targets:
target_file: android_platform_tests.yaml
channel: master
version_file: flutter_master.version
# set up for 34
package_sharding: "--shardIndex 5 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_api_33_shard_1 master
Expand All @@ -388,6 +396,7 @@ targets:
target_file: android_platform_tests_api_33.yaml
channel: master
version_file: flutter_master.version
# set up for 33
package_sharding: "--shardIndex 0 --shardCount 2"
dependencies: >-
[
Expand All @@ -402,6 +411,7 @@ targets:
target_file: android_platform_tests_api_33.yaml
channel: master
version_file: flutter_master.version
# set up for 33
package_sharding: "--shardIndex 1 --shardCount 2"
dependencies: >-
[
Expand All @@ -419,7 +429,7 @@ targets:
package_sharding: "--shardIndex 0 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_2 stable
Expand All @@ -433,7 +443,7 @@ targets:
package_sharding: "--shardIndex 1 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_3 stable
Expand All @@ -447,7 +457,7 @@ targets:
package_sharding: "--shardIndex 2 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_4 stable
Expand All @@ -461,7 +471,7 @@ targets:
package_sharding: "--shardIndex 3 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_5 stable
Expand All @@ -475,7 +485,7 @@ targets:
package_sharding: "--shardIndex 4 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

- name: Linux_android android_platform_tests_shard_6 stable
Expand All @@ -489,7 +499,7 @@ targets:
package_sharding: "--shardIndex 5 --shardCount 6"
dependencies: >-
[
{"dependency": "android_virtual_device", "version": "33"}
{"dependency": "android_virtual_device", "version": "34"}
]

Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to add matching stable shards, or we'll lose coverage on stable since they are running the same scripts. That can be done in the same prequel PR.

- name: Linux_android android_platform_tests_api_33_shard_1 stable
Expand Down
12 changes: 6 additions & 6 deletions .ci/targets/android_platform_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ tasks:
- name: download Dart and Android deps
script: script/tool_runner.sh
infra_step: true
args: ["fetch-deps", "--android", "--supporting-target-platforms-only"]
args: ["fetch-deps", "--android", "--supporting-target-platforms-only", "--exclude=script/configs/still_requires_api_33_avd.yaml"]
- name: build examples
script: script/tool_runner.sh
args: ["build-examples", "--apk"]
args: ["build-examples", "--apk", "--exclude=script/configs/still_requires_api_33_avd.yaml"]
- name: lint
script: script/tool_runner.sh
args: ["lint-android"]
args: ["lint-android", "--exclude=script/configs/still_requires_api_33_avd.yaml"]
# Native unit and native integration are split into two steps to allow for
# different exclusions.
# TODO(stuartmorgan): Eliminate the native unit test exclusion, and combine
# these steps.
- name: native unit tests
script: script/tool_runner.sh
args: ["native-test", "--android", "--no-integration", "--exclude=script/configs/exclude_native_unit_android.yaml"]
args: ["native-test", "--android", "--no-integration", "--exclude=script/configs/exclude_native_unit_android.yaml,script/configs/still_requires_api_33_avd.yaml"]
- name: native integration tests
script: script/tool_runner.sh
args: ["native-test", "--android", "--no-unit"]
args: ["native-test", "--android", "--no-unit", "--exclude=script/configs/still_requires_api_33_avd.yaml"]
- name: drive examples
script: script/tool_runner.sh
args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml"]
args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml,script/configs/still_requires_api_33_avd.yaml"]
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ void main() {
_verifySampleFile(result, 'library');
} else if (Platform.isAndroid) {
final Future<Directory?> result = getLibraryDirectory();
await expectLater(result, throwsA(isInstanceOf<UnsupportedError>()));
expect(result, throwsA(isInstanceOf<UnsupportedError>()));
}
});

testWidgets('getExternalStorageDirectory', (WidgetTester tester) async {
if (Platform.isIOS) {
final Future<Directory?> result = getExternalStorageDirectory();
await expectLater(result, throwsA(isInstanceOf<UnsupportedError>()));
expect(result, throwsA(isInstanceOf<UnsupportedError>()));
} else if (Platform.isAndroid) {
final Directory? result = await getExternalStorageDirectory();
_verifySampleFile(result, 'externalStorage');
Expand All @@ -53,7 +53,7 @@ void main() {
testWidgets('getExternalCacheDirectories', (WidgetTester tester) async {
if (Platform.isIOS) {
final Future<List<Directory>?> result = getExternalCacheDirectories();
await expectLater(result, throwsA(isInstanceOf<UnsupportedError>()));
expect(result, throwsA(isInstanceOf<UnsupportedError>()));
} else if (Platform.isAndroid) {
final List<Directory>? directories = await getExternalCacheDirectories();
expect(directories, isNotNull);
Expand All @@ -79,7 +79,7 @@ void main() {
(WidgetTester tester) async {
if (Platform.isIOS) {
final Future<List<Directory>?> result = getExternalStorageDirectories();
await expectLater(result, throwsA(isInstanceOf<UnsupportedError>()));
expect(result, throwsA(isInstanceOf<UnsupportedError>()));
} else if (Platform.isAndroid) {
final List<Directory>? directories =
await getExternalStorageDirectories(type: type);
Expand Down
5 changes: 5 additions & 0 deletions packages/path_provider/path_provider_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.2.1

* Adds permissions to read images, video, and audio files to ensure external
directories exist in testing.

## 2.2.0

* Adds implementation of `getDownloadsDirectory()`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
package="io.flutter.plugins.pathproviderexample">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> !
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<application android:label="path_provider_example" android:icon="@mipmap/ic_launcher">
<activity android:name="io.flutter.embedding.android.FlutterActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: path_provider_android
description: Android implementation of the path_provider plugin.
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
version: 2.2.0
version: 2.2.1

environment:
sdk: ">=2.19.0 <4.0.0"
Expand Down