diff --git a/.cirrus.yml b/.cirrus.yml index 97d6bbed62..10f7ffef67 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -62,6 +62,14 @@ task: container: cpu: 4 memory: 8G + - name: aot_build_tests-linux + env: + SHARD: aot_build_tests + test_script: + - dart ./dev/bots/test.dart + container: + cpu: 4 + memory: 8G - name: codelabs-build-test env: SHARD: codelabs-build-test diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 3a8b62dc1d..a49a1a5647 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -21,6 +21,7 @@ final List flutterTestArgs = []; const Map _kShards = { 'tests': _runTests, 'tool_tests': _runToolTests, + 'aot_build_tests': _runAotBuildTests, 'coverage': _runCoverage, }; @@ -149,6 +150,27 @@ Future _runToolTests() async { print('${bold}DONE: All tests successful.$reset'); } +/// Verifies that AOT builds of some examples apps finish +/// without crashing. It does not actually launch the AOT-built +/// apps. That happens later in the devicelab. This is just +/// a smoke-test. +Future _runAotBuildTests() async { + await _flutterBuildAot(path.join('examples', 'hello_world')); + await _flutterBuildAot(path.join('examples', 'flutter_gallery')); + await _flutterBuildAot(path.join('examples', 'flutter_view')); + + print('${bold}DONE: All AOT build tests successful.$reset'); +} + +Future _flutterBuildAot(String relativePathToApplication) { + return runCommand(flutter, + ['build', 'aot'], + workingDirectory: path.join(flutterRoot, relativePathToApplication), + expectNonZeroExit: false, + timeout: _kShortTimeout, + ); +} + Future _runTests() async { await _runSmokeTests();