Unverified Commit 36305256 authored by Dan Field's avatar Dan Field Committed by GitHub

Shard gradle tests (#34857)

parent 63438b92
...@@ -130,6 +130,48 @@ task: ...@@ -130,6 +130,48 @@ task:
container: container:
cpu: 4 cpu: 4
memory: 12G memory: 12G
- name: integration_tests_gradle1-linux
env:
SHARD: integration_tests
SUBSHARD: gradle1
test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# See: https://github.com/flutter/flutter/issues/24935
# This is a temporary workaround until we figure how to properly configure
# a UTF8 locale on Cirrus (or until the Gradle bug is fixed).
# TODO(amirh): Set the locale to UTF8.
- echo "$CIRRUS_CHANGE_MESSAGE" > /tmp/cirrus_change_message.txt
- echo "$CIRRUS_COMMIT_MESSAGE" > /tmp/cirrus_commit_message.txt
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- dart --enable-asserts ./dev/bots/test.dart
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
container:
cpu: 4
memory: 12G
- name: integration_tests_gradle2-linux
env:
SHARD: integration_tests
SUBSHARD: gradle2
test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# See: https://github.com/flutter/flutter/issues/24935
# This is a temporary workaround until we figure how to properly configure
# a UTF8 locale on Cirrus (or until the Gradle bug is fixed).
# TODO(amirh): Set the locale to UTF8.
- echo "$CIRRUS_CHANGE_MESSAGE" > /tmp/cirrus_change_message.txt
- echo "$CIRRUS_COMMIT_MESSAGE" > /tmp/cirrus_commit_message.txt
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- dart --enable-asserts ./dev/bots/test.dart
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
container:
cpu: 4
memory: 12G
- name: release_smoke_tests - name: release_smoke_tests
env: env:
CLOUDSDK_CORE_DISABLE_PROMPTS: 1 CLOUDSDK_CORE_DISABLE_PROMPTS: 1
...@@ -328,6 +370,7 @@ docker_builder: ...@@ -328,6 +370,7 @@ docker_builder:
- tool_tests-linux - tool_tests-linux
- build_tests-linux - build_tests-linux
- integration_tests-linux - integration_tests-linux
- integration_tests_gradle-linux
build_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_build.sh" build_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_build.sh"
login_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_login.sh" login_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_login.sh"
push_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_push.sh" push_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_push.sh"
...@@ -797,19 +797,28 @@ Future<void> _verifyVersion(String filename) async { ...@@ -797,19 +797,28 @@ Future<void> _verifyVersion(String filename) async {
} }
Future<void> _runIntegrationTests() async { Future<void> _runIntegrationTests() async {
print('Platform env vars:'); final String subShard = Platform.environment['SUBSHARD'];
await _runDevicelabTest('dartdocs');
if (Platform.isLinux) { switch (subShard) {
await _runDevicelabTest('flutter_create_offline_test_linux'); case 'gradle1':
} else if (Platform.isWindows) { case 'gradle2':
await _runDevicelabTest('flutter_create_offline_test_windows'); // This runs some gradle integration tests if the subshard is Android.
} else if (Platform.isMacOS) { await _androidGradleTests(subShard);
await _runDevicelabTest('flutter_create_offline_test_mac'); break;
await _runDevicelabTest('module_test_ios'); default:
await _runDevicelabTest('dartdocs');
if (Platform.isLinux) {
await _runDevicelabTest('flutter_create_offline_test_linux');
} else if (Platform.isWindows) {
await _runDevicelabTest('flutter_create_offline_test_windows');
} else if (Platform.isMacOS) {
await _runDevicelabTest('flutter_create_offline_test_mac');
await _runDevicelabTest('module_test_ios');
}
// This does less work if the subshard isn't Android.
await _androidPluginTest();
} }
await _integrationTestsAndroidSdk();
} }
Future<void> _runDevicelabTest(String testName, {Map<String, String> env}) async { Future<void> _runDevicelabTest(String testName, {Map<String, String> env}) async {
...@@ -821,12 +830,19 @@ Future<void> _runDevicelabTest(String testName, {Map<String, String> env}) async ...@@ -821,12 +830,19 @@ Future<void> _runDevicelabTest(String testName, {Map<String, String> env}) async
); );
} }
Future<void> _integrationTestsAndroidSdk() async { String get androidSdkRoot {
final String androidSdkRoot = (Platform.environment['ANDROID_HOME']?.isEmpty ?? true) final String androidSdkRoot = (Platform.environment['ANDROID_HOME']?.isEmpty ?? true)
? Platform.environment['ANDROID_SDK_ROOT'] ? Platform.environment['ANDROID_SDK_ROOT']
: Platform.environment['ANDROID_HOME']; : Platform.environment['ANDROID_HOME'];
if (androidSdkRoot == null || androidSdkRoot.isEmpty) { if (androidSdkRoot == null || androidSdkRoot.isEmpty) {
print('No Android SDK detected, skipping Android Integration Tests'); return null;
}
return androidSdkRoot;
}
Future<void> _androidPluginTest() async {
if (androidSdkRoot == null) {
print('No Android SDK detected, skipping Android Plugin test.');
return; return;
} }
...@@ -835,13 +851,27 @@ Future<void> _integrationTestsAndroidSdk() async { ...@@ -835,13 +851,27 @@ Future<void> _integrationTestsAndroidSdk() async {
'ANDROID_SDK_ROOT': androidSdkRoot, 'ANDROID_SDK_ROOT': androidSdkRoot,
}; };
await _runDevicelabTest('plugin_test', env: env);
}
Future<void> _androidGradleTests(String subShard) async {
// TODO(dnfield): gradlew is crashing on the cirrus image and it's not clear why. // TODO(dnfield): gradlew is crashing on the cirrus image and it's not clear why.
if (!Platform.isWindows) { if (androidSdkRoot == null || Platform.isWindows) {
print('No Android SDK detected or on Windows, skipping Android gradle test.');
return;
}
final Map<String, String> env = <String, String> {
'ANDROID_HOME': androidSdkRoot,
'ANDROID_SDK_ROOT': androidSdkRoot,
};
if (subShard == 'gradle1') {
await _runDevicelabTest('gradle_plugin_light_apk_test', env: env); await _runDevicelabTest('gradle_plugin_light_apk_test', env: env);
await _runDevicelabTest('gradle_plugin_fat_apk_test', env: env); await _runDevicelabTest('gradle_plugin_fat_apk_test', env: env);
}
if (subShard == 'gradle2') {
await _runDevicelabTest('gradle_plugin_bundle_test', env: env); await _runDevicelabTest('gradle_plugin_bundle_test', env: env);
await _runDevicelabTest('module_test', env: env); await _runDevicelabTest('module_test', env: env);
} }
// note: this also covers plugin_test_win as long as Windows has an Android SDK available.
await _runDevicelabTest('plugin_test', env: env);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment