about summary refs log tree commit diff
path: root/src/ci/docker/scripts
diff options
context:
space:
mode:
authorCharles Celerier <chcl@google.com>2024-07-06 05:15:38 +0000
committerCharles Celerier <chcl@google.com>2024-07-07 15:37:20 +0000
commit54aa9e8ba2efe68bfcf5c407a5a9cf1a8d17b354 (patch)
treedfe0c0f92133845faa231302dc4e221e918feff1 /src/ci/docker/scripts
parent1086affd98ad746e1bb02e187562b9a037e854e3 (diff)
downloadrust-54aa9e8ba2efe68bfcf5c407a5a9cf1a8d17b354.tar.gz
rust-54aa9e8ba2efe68bfcf5c407a5a9cf1a8d17b354.zip
[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
Diffstat (limited to 'src/ci/docker/scripts')
-rwxr-xr-xsrc/ci/docker/scripts/fuchsia-test-runner.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/ci/docker/scripts/fuchsia-test-runner.py b/src/ci/docker/scripts/fuchsia-test-runner.py
index 6db25ff1a80..1a2e69712a9 100755
--- a/src/ci/docker/scripts/fuchsia-test-runner.py
+++ b/src/ci/docker/scripts/fuchsia-test-runner.py
@@ -271,13 +271,6 @@ class TestEnvironment:
             logfile_handler.setLevel(logging.DEBUG)
             logfile_handler.setFormatter(fs)
             logging.getLogger().addHandler(logfile_handler)
-        stream_handler = logging.StreamHandler(sys.stdout)
-        stream_handler.setFormatter(fs)
-        if self.verbose:
-            stream_handler.setLevel(logging.DEBUG)
-        else:
-            stream_handler.setLevel(logging.INFO)
-        logging.getLogger().addHandler(stream_handler)
         logging.getLogger().setLevel(logging.DEBUG)
 
     @property
@@ -927,7 +920,7 @@ class TestEnvironment:
                 )
             else:
                 with open(stdout_path, encoding="utf-8", errors="ignore") as f:
-                    runner_logger.info(f.read())
+                    sys.stdout.write(f.read())
         if stderr_path is not None:
             if not os.path.exists(stderr_path):
                 runner_logger.error(
@@ -935,7 +928,7 @@ class TestEnvironment:
                 )
             else:
                 with open(stderr_path, encoding="utf-8", errors="ignore") as f:
-                    runner_logger.error(f.read())
+                    sys.stderr.write(f.read())
 
         runner_logger.info("Done!")
         return return_code