From 15779b7847ab2bd1c1bba6fb6d0d228255381967 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 11 Mar 2024 12:10:57 -0700 Subject: [PATCH] Conditionally run `golden_tests_harvester` for `run_impeller_golden_tests`. (flutter/engine#51325) I think this restores the behavior prior to https://github.com/flutter/engine/pull/50844 without making the client code faulty. I'll file a follow-up issue, I don't think `golden_tests_harvester` should accept running if `GOLDCTL` isn't set: https://github.com/flutter/flutter/issues/144948. /cc @godofredoc --- engine/src/flutter/testing/run_tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 5003b37222..3617937f9f 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -1052,6 +1052,16 @@ def run_impeller_golden_tests(build_dir: str): print(diff_result.stdout.decode()) raise RuntimeError('impeller_golden_tests diff failure') + # 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: + print_divider('<') + print( + 'Skipping the SkiaGoldClient invocation as the GOLDCTL environment variable is not set.' + ) + return + with DirectoryChange(harvester_path): bin_path = Path('.').joinpath('bin').joinpath('golden_tests_harvester.dart') run_cmd([dart_bin, 'run', str(bin_path), temp_dir])