diff --git a/engine/src/flutter/ci/builders/mac_unopt.json b/engine/src/flutter/ci/builders/mac_unopt.json index d9957b92be..934cdf23b2 100644 --- a/engine/src/flutter/ci/builders/mac_unopt.json +++ b/engine/src/flutter/ci/builders/mac_unopt.json @@ -166,7 +166,8 @@ "ci/host_debug_unopt_arm64", "--type", "dart,dart-host,engine,impeller-golden", - "--engine-capture-core-dump" + "--engine-capture-core-dump", + "--no-skia-gold" ] } ] diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 2086604603..1a0f4526be 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -1053,7 +1053,7 @@ class DirectoryChange(): os.chdir(self.old_cwd) -def run_impeller_golden_tests(build_dir: str): +def run_impeller_golden_tests(build_dir: str, require_skia_gold: bool = False): """ Executes the impeller golden image tests from in the `variant` build. """ @@ -1085,10 +1085,27 @@ def run_impeller_golden_tests(build_dir: str): print(diff_result.stdout.decode()) raise RuntimeError('impeller_golden_tests diff failure') + if not require_skia_gold: + print_divider('<') + print('Skipping any SkiaGoldClient invocation as the --no-skia-gold flag was set.') + return + # On release builds and local builds, we typically do not have GOLDCTL set, # which on other words means that this invoking the SkiaGoldClient would # throw. Skip this step in those cases and log a notice. if 'GOLDCTL' not in os.environ: + # On CI, we never want to be running golden tests without Skia Gold. + # See https://github.com/flutter/flutter/issues/147180 as an example. + is_luci = 'LUCI_CONTEXT' in os.environ + if is_luci: + raise RuntimeError( + """ +The GOLDCTL environment variable is not set. This is required for Skia Gold tests. +See https://github.com/flutter/engine/tree/main/testing/skia_gold_client#configuring-ci +for more information. +""" + ) + print_divider('<') print( 'Skipping the SkiaGoldClient invocation as the GOLDCTL environment variable is not set.' @@ -1223,6 +1240,13 @@ Flutter Wiki page on the subject: https://github.com/flutter/flutter/wiki/Testin type=str, help='The directory that verbose logs will be copied to in --quiet mode.', ) + parser.add_argument( + '--no-skia-gold', + dest='no_skia_gold', + action='store_true', + default=False, + help='Do not compare golden images with Skia Gold.', + ) args = parser.parse_args() @@ -1341,7 +1365,7 @@ Flutter Wiki page on the subject: https://github.com/flutter/flutter/wiki/Testin run_cmd(cmd, cwd=FONT_SUBSET_DIR) if 'impeller-golden' in types: - run_impeller_golden_tests(build_dir) + run_impeller_golden_tests(build_dir, require_skia_gold=not args.no_skia_gold) if args.quiet and args.logs_dir: shutil.copy(LOG_FILE, os.path.join(args.logs_dir, 'run_tests.log'))