From 640ad94161019bb9a12b377c11c6a8655d9a316f Mon Sep 17 00:00:00 2001 From: Tong Mu Date: Tue, 19 Jan 2021 23:04:53 -0800 Subject: [PATCH] ci: Print output in case of compile error (flutter/engine#23522) * Print compile error * Better comment * Update run_tests.py --- engine/src/flutter/testing/run_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 9cdd1e6333..d5dd747ffd 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -214,7 +214,14 @@ def SnapshotTest(build_dir, dart_file, kernel_file_output, verbose_dart_snapshot if verbose_dart_snapshot: RunCmd(snapshot_command, cwd=buildroot_dir) else: - subprocess.check_output(snapshot_command, cwd=buildroot_dir) + try: + subprocess.check_output(snapshot_command, cwd=buildroot_dir) + except subprocess.CalledProcessError as error: + # CalledProcessError's string doesn't print the output. Print it before + # the crash for easier inspection. + print('Error occurred from the subprocess, with the output:') + print(error.output) + raise assert os.path.exists(kernel_file_output)