diff --git a/.ci.yaml b/.ci.yaml index 45cbaacfe22de..5d9d99027b172 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -54,6 +54,10 @@ targets: recipe: engine_v2/engine_v2 properties: config_name: linux_android_emulator + dependencies: >- + [ + {"dependency": "goldctl", "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"} + ] timeout: 60 runIf: - .ci.yaml @@ -71,6 +75,10 @@ targets: recipe: engine_v2/engine_v2 properties: config_name: linux_android_emulator_api_33 + dependencies: >- + [ + {"dependency": "goldctl", "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"} + ] timeout: 60 runIf: - .ci.yaml diff --git a/ci/builders/linux_android_emulator.json b/ci/builders/linux_android_emulator.json index 4ef64af57e506..643eb4da6c744 100644 --- a/ci/builders/linux_android_emulator.json +++ b/ci/builders/linux_android_emulator.json @@ -17,6 +17,12 @@ "--rbe", "--no-goma" ], + "dependencies": [ + { + "dependency": "goldctl", + "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd" + } + ], "name": "android_debug_x64", "ninja": { "config": "android_debug_x64", diff --git a/ci/builders/linux_android_emulator_api_33.json b/ci/builders/linux_android_emulator_api_33.json index 3e518f1ab40d6..2457782fda800 100644 --- a/ci/builders/linux_android_emulator_api_33.json +++ b/ci/builders/linux_android_emulator_api_33.json @@ -17,6 +17,12 @@ "--rbe", "--no-goma" ], + "dependencies": [ + { + "dependency": "goldctl", + "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd" + } + ], "name": "android_debug_x64", "ninja": { "config": "android_debug_x64", diff --git a/testing/scenario_app/bin/android_integration_tests.dart b/testing/scenario_app/bin/android_integration_tests.dart index 9517ee350ddf8..07b31d0a4a97d 100644 --- a/testing/scenario_app/bin/android_integration_tests.dart +++ b/testing/scenario_app/bin/android_integration_tests.dart @@ -21,18 +21,23 @@ void main(List args) async { final ArgParser parser = ArgParser() ..addOption( 'adb', - help: 'absolute path to the adb tool', + help: 'Absolute path to the adb tool', mandatory: true, ) ..addOption( 'out-dir', - help: 'out directory', + help: 'Out directory', mandatory: true, ) - ..addFlag( + ..addOption( 'smoke-test', help: 'runs a single test to verify the setup', - negatable: false, + valueHelp: 'The class to execute, defaults to dev.flutter.scenarios.EngineLaunchE2ETest', + ) + ..addFlag( + 'use-skia-gold', + help: 'Use Skia Gold to compare screenshots.', + defaultsTo: isLuciEnv, ); runZonedGuarded( @@ -40,8 +45,17 @@ void main(List args) async { final ArgResults results = parser.parse(args); final Directory outDir = Directory(results['out-dir'] as String); final File adb = File(results['adb'] as String); - final bool smokeTest = results['smoke-test'] as bool; - await _run(outDir: outDir, adb: adb, smokeTest: smokeTest); + final bool useSkiaGold = results['use-skia-gold'] as bool; + String? smokeTest = results['smoke-test'] as String?; + if (results.wasParsed('smoke-test') && smokeTest!.isEmpty) { + smokeTest = 'dev.flutter.scenarios.EngineLaunchE2ETest'; + } + await _run( + outDir: outDir, + adb: adb, + smokeTestFullPath: smokeTest, + useSkiaGold: useSkiaGold, + ); exit(0); }, (Object error, StackTrace stackTrace) { @@ -57,7 +71,8 @@ void main(List args) async { Future _run({ required Directory outDir, required File adb, - required bool smokeTest, + required String? smokeTestFullPath, + required bool useSkiaGold, }) async { const ProcessManager pm = LocalProcessManager(); @@ -178,7 +193,11 @@ Future _run({ await skiaGoldClient!.auth(); log('skia gold client is available'); } else { - log('skia gold client is unavailable'); + if (useSkiaGold) { + panic(['skia gold client is unavailable']); + } else { + log('skia gold client is unavaialble'); + } } }); @@ -210,8 +229,8 @@ Future _run({ 'am', 'instrument', '-w', - if (smokeTest) - '-e class dev.flutter.scenarios.EngineLaunchE2ETest', + if (smokeTestFullPath != null) + '-e class $smokeTestFullPath', 'dev.flutter.scenarios.test/dev.flutter.TestRunner', ]); if (exitCode != 0) {