From e9527be661f464b0f0bef40c5d4f5a8dea8732f9 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Sat, 24 Apr 2021 19:29:01 -0700 Subject: [PATCH] Ensure stdout and stderr from failed test runs are reported from `run_tests.py`. (flutter/engine#25758) --- engine/src/flutter/testing/run_tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index cf095400de..f37904cee6 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -46,7 +46,18 @@ def RunCmd(cmd, forbidden_output=[], **kwargs): if process.returncode != 0: PrintDivider('!') - raise Exception('Command "%s" exited with code %d' % (command_string, process.returncode)) + + print('Failed Command:\n\n%s\n\nExit Code: %d\n' % (command_string, process.returncode)) + + if stdout: + print('STDOUT: \n%s' % stdout) + + if stderr: + print('STDERR: \n%s' % stderr) + + PrintDivider('!') + + raise Exception('Command "%s" exited with code %d.' % (command_string, process.returncode)) if stdout or stderr: print(stdout)