Shard firebase_test_lab_tests (#56594)

This commit is contained in:
Jenn Magder
2020-05-08 16:32:17 -07:00
committed by GitHub
parent e04450c000
commit 3cb04ff9aa
3 changed files with 55 additions and 19 deletions

View File

@@ -8,11 +8,8 @@
# that the app doesn't crash upon startup.
#
# When adding a test, ensure that there's at least a `print()` statement under lib/*.dart.
tests=(
"dev/integration_tests/release_smoke_test"
"dev/integration_tests/abstract_method_smoke_test"
"dev/integration_tests/android_embedding_v2_smoke_test"
)
#
# The first and only parameter should be the path to an integration test.
# The devices where the tests are run.
#
@@ -79,6 +76,4 @@ function test_app_bundle() {
popd
}
for test in ${tests[*]}; do
test_app_bundle $test
done
test_app_bundle "$1"

View File

@@ -118,6 +118,7 @@ Future<void> main(List<String> args) async {
'add_to_app_tests': _runAddToAppTests,
'add_to_app_life_cycle_tests': _runAddToAppLifeCycleTests,
'build_tests': _runBuildTests,
'firebase_test_lab_tests': _runFirebaseTestLabTests,
'framework_coverage': _runFrameworkCoverage,
'framework_tests': _runFrameworkTests,
'hostonly_devicelab_tests': _runHostOnlyDeviceLabTests,
@@ -634,6 +635,34 @@ Future<void> _runFrameworkTests() async {
});
}
Future<void> _runFirebaseTestLabTests() async {
// Firebase Lab tests take ~20 minutes per integration test,
// so only one test is run per shard. Therefore, there are as
// many shards available as there are integration tests in this list.
// If you add a new test, add a corresponding firebase_test_lab-#-linux
// to .cirrus.yml
final List<String> integrationTests = <String>[
'release_smoke_test',
'abstract_method_smoke_test',
'android_embedding_v2_smoke_test',
];
final Map<String, ShardRunner> subshards = <String, ShardRunner>{};
final String firebaseScript = path.join(flutterRoot, 'dev', 'bots', 'firebase_testlab.sh');
final String integrationTestDirectory = path.join(flutterRoot, 'dev', 'integration_tests');
for (int index = 0; index < integrationTests.length; index += 1) {
final String integrationTestPath = path.join(integrationTestDirectory, integrationTests[index]);
subshards['$index'] = () => runCommand(
firebaseScript,
<String>[ integrationTestPath ],
workingDirectory: flutterRoot,
);
}
await selectSubshard(subshards);
}
Future<void> _runFrameworkCoverage() async {
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
if (!coverageFile.existsSync()) {