mirror of
https://github.com/flutter/packages.git
synced 2025-06-30 06:37:17 +08:00
[ci] Enable Android emulator-based tests (#4494)
Adds emulators to the Android platform test tasks, and enable both native integration tests and `flutter test` Dart integration tests. This finally gives us presubmit coverage of Android integration tests for non-team-member PRs, as well as giving us a path to reducing the dependency on FTL for all of our Android testing. Currently this uses Android 13 emulators; we could expand this to a set of legacy version emulator tests in the future once this is in place. Some specific notes: - Camera and Google Maps tests are currently excluded, so that we can enable everything else while we work on the blockers for those. - `shared_preferences` was missing its debug entitlement, which prevented the debug service from running, and thus broke `flutter test`; we'd just never noticed because FTL tests don't need that mechanism to work. - IAP was using `test` instead of `testWidget`, which we only check for in `drive-examples`, so hadn't noticed. Fixes https://github.com/flutter/flutter/issues/93810
This commit is contained in:
48
.ci.yaml
48
.ci.yaml
@ -310,6 +310,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 0 --shardCount 6"
|
package_sharding: "--shardIndex 0 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_2 master
|
- name: Linux_android android_platform_tests_shard_2 master
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -319,6 +323,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 1 --shardCount 6"
|
package_sharding: "--shardIndex 1 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_3 master
|
- name: Linux_android android_platform_tests_shard_3 master
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -328,6 +336,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 2 --shardCount 6"
|
package_sharding: "--shardIndex 2 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_4 master
|
- name: Linux_android android_platform_tests_shard_4 master
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -337,6 +349,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 3 --shardCount 6"
|
package_sharding: "--shardIndex 3 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_5 master
|
- name: Linux_android android_platform_tests_shard_5 master
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -346,6 +362,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 4 --shardCount 6"
|
package_sharding: "--shardIndex 4 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_6 master
|
- name: Linux_android android_platform_tests_shard_6 master
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -355,6 +375,10 @@ targets:
|
|||||||
channel: master
|
channel: master
|
||||||
version_file: flutter_master.version
|
version_file: flutter_master.version
|
||||||
package_sharding: "--shardIndex 5 --shardCount 6"
|
package_sharding: "--shardIndex 5 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_1 stable
|
- name: Linux_android android_platform_tests_shard_1 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -365,6 +389,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 0 --shardCount 6"
|
package_sharding: "--shardIndex 0 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_2 stable
|
- name: Linux_android android_platform_tests_shard_2 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -375,6 +403,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 1 --shardCount 6"
|
package_sharding: "--shardIndex 1 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_3 stable
|
- name: Linux_android android_platform_tests_shard_3 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -385,6 +417,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 2 --shardCount 6"
|
package_sharding: "--shardIndex 2 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_4 stable
|
- name: Linux_android android_platform_tests_shard_4 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -395,6 +431,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 3 --shardCount 6"
|
package_sharding: "--shardIndex 3 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_5 stable
|
- name: Linux_android android_platform_tests_shard_5 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -405,6 +445,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 4 --shardCount 6"
|
package_sharding: "--shardIndex 4 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Linux_android android_platform_tests_shard_6 stable
|
- name: Linux_android android_platform_tests_shard_6 stable
|
||||||
recipe: packages/packages
|
recipe: packages/packages
|
||||||
@ -415,6 +459,10 @@ targets:
|
|||||||
channel: stable
|
channel: stable
|
||||||
version_file: flutter_stable.version
|
version_file: flutter_stable.version
|
||||||
package_sharding: "--shardIndex 5 --shardCount 6"
|
package_sharding: "--shardIndex 5 --shardCount 6"
|
||||||
|
dependencies: >-
|
||||||
|
[
|
||||||
|
{"dependency": "android_virtual_device", "version": "33"}
|
||||||
|
]
|
||||||
|
|
||||||
### Web tasks ###
|
### Web tasks ###
|
||||||
- name: Linux_web web_build_all_packages master
|
- name: Linux_web web_build_all_packages master
|
||||||
|
@ -19,12 +19,9 @@ tasks:
|
|||||||
- name: native unit tests
|
- name: native unit tests
|
||||||
script: script/tool_runner.sh
|
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"]
|
||||||
# TODO(stuartmorgan): Enable these once
|
- name: native integration tests
|
||||||
# https://github.com/flutter/flutter/issues/120736 is implemented.
|
script: script/tool_runner.sh
|
||||||
# See also https://github.com/flutter/flutter/issues/114373
|
args: ["native-test", "--android", "--no-unit"]
|
||||||
#- name: native integration tests
|
- name: drive examples
|
||||||
# script: script/tool_runner.sh
|
script: script/tool_runner.sh
|
||||||
# args: ["native-test", "--android", "--no-unit"]
|
args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml"]
|
||||||
#- name: drive examples
|
|
||||||
# script: script/tool_runner.sh
|
|
||||||
# args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml"]
|
|
||||||
|
@ -30,7 +30,8 @@ void main() {
|
|||||||
billingClient = BillingClient((PurchasesResultWrapper _) {});
|
billingClient = BillingClient((PurchasesResultWrapper _) {});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.acknowledgePurchase', () async {
|
testWidgets('BillingClient.acknowledgePurchase',
|
||||||
|
(WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.acknowledgePurchase('purchaseToken');
|
await billingClient.acknowledgePurchase('purchaseToken');
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -38,7 +39,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.consumeAsync', () async {
|
testWidgets('BillingClient.consumeAsync', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.consumeAsync('purchaseToken');
|
await billingClient.consumeAsync('purchaseToken');
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -46,7 +47,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.endConnection', () async {
|
testWidgets('BillingClient.endConnection', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.endConnection();
|
await billingClient.endConnection();
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -54,7 +55,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.isFeatureSupported', () async {
|
testWidgets('BillingClient.isFeatureSupported',
|
||||||
|
(WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient
|
await billingClient
|
||||||
.isFeatureSupported(BillingClientFeature.productDetails);
|
.isFeatureSupported(BillingClientFeature.productDetails);
|
||||||
@ -63,7 +65,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.isReady', () async {
|
testWidgets('BillingClient.isReady', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.isReady();
|
await billingClient.isReady();
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -71,7 +73,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.launchBillingFlow', () async {
|
testWidgets('BillingClient.launchBillingFlow', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.launchBillingFlow(product: 'product');
|
await billingClient.launchBillingFlow(product: 'product');
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -84,7 +86,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.queryProductDetails', () async {
|
testWidgets('BillingClient.queryProductDetails',
|
||||||
|
(WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient
|
await billingClient
|
||||||
.queryProductDetails(productList: <ProductWrapper>[]);
|
.queryProductDetails(productList: <ProductWrapper>[]);
|
||||||
@ -99,7 +102,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.queryPurchaseHistory', () async {
|
testWidgets('BillingClient.queryPurchaseHistory',
|
||||||
|
(WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.queryPurchaseHistory(ProductType.inapp);
|
await billingClient.queryPurchaseHistory(ProductType.inapp);
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -107,7 +111,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.queryPurchases', () async {
|
testWidgets('BillingClient.queryPurchases', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.queryPurchases(ProductType.inapp);
|
await billingClient.queryPurchases(ProductType.inapp);
|
||||||
} on MissingPluginException {
|
} on MissingPluginException {
|
||||||
@ -115,7 +119,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('BillingClient.startConnection', () async {
|
testWidgets('BillingClient.startConnection', (WidgetTester tester) async {
|
||||||
try {
|
try {
|
||||||
await billingClient.startConnection(
|
await billingClient.startConnection(
|
||||||
onBillingServiceDisconnected: () {});
|
onBillingServiceDisconnected: () {});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
## NEXT
|
## NEXT
|
||||||
|
|
||||||
|
* Fixes the example app to be debuggable on Android.
|
||||||
* Deletes deprecated splash screen meta-data element.
|
* Deletes deprecated splash screen meta-data element.
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="io.flutter.plugins.sharedpreferencesexample">
|
||||||
|
<!-- Flutter needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
8
script/configs/exclude_integration_android_emulator.yaml
Normal file
8
script/configs/exclude_integration_android_emulator.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Hangs due to permission issue, see https://github.com/flutter/flutter/issues/130987
|
||||||
|
# TODO(stuartmorgan): Remove once the permission issue is addressed.
|
||||||
|
- camera/camera
|
||||||
|
- camera_android
|
||||||
|
- camera_android_camerax
|
||||||
|
# Frequent flaky failures, see https://github.com/flutter/flutter/issues/130986
|
||||||
|
# TODO(stuartmorgan): Remove once the flake is fixed.
|
||||||
|
- google_maps_flutter_android
|
Reference in New Issue
Block a user