Skip to content

Commit 54aa9e8

Browse files
committed
[fuchsia-test-runner] Remove runner logs from stdout and stderr
Many tests use stdout and stderr to validate whether the test emitted the correct output. Because fuchsia-test-runner.py was sending all logs, including test output, to stdout, tests could not validate output properly. This change removes the runner logs from stdout and stderr entirely with the exception of output from the test. All runner logs are still available in the "log" file. Fixed: https://fxbug.dev/351356417
1 parent 1086aff commit 54aa9e8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/ci/docker/scripts/fuchsia-test-runner.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ def setup_logging(self, log_to_file=False):
271271
logfile_handler.setLevel(logging.DEBUG)
272272
logfile_handler.setFormatter(fs)
273273
logging.getLogger().addHandler(logfile_handler)
274-
stream_handler = logging.StreamHandler(sys.stdout)
275-
stream_handler.setFormatter(fs)
276-
if self.verbose:
277-
stream_handler.setLevel(logging.DEBUG)
278-
else:
279-
stream_handler.setLevel(logging.INFO)
280-
logging.getLogger().addHandler(stream_handler)
281274
logging.getLogger().setLevel(logging.DEBUG)
282275

283276
@property
@@ -927,15 +920,15 @@ def run(self, args):
927920
)
928921
else:
929922
with open(stdout_path, encoding="utf-8", errors="ignore") as f:
930-
runner_logger.info(f.read())
923+
sys.stdout.write(f.read())
931924
if stderr_path is not None:
932925
if not os.path.exists(stderr_path):
933926
runner_logger.error(
934927
f"stderr file {stderr_path} does not exist."
935928
)
936929
else:
937930
with open(stderr_path, encoding="utf-8", errors="ignore") as f:
938-
runner_logger.error(f.read())
931+
sys.stderr.write(f.read())
939932

940933
runner_logger.info("Done!")
941934
return return_code

0 commit comments

Comments
 (0)