From 4c6d2bf9215e2ceb7c22a0bd8ae40077f1751d63 Mon Sep 17 00:00:00 2001 From: Disservin Date: Tue, 4 Feb 2025 22:21:44 +0100 Subject: [PATCH] Show stdout/stderr in CI/CD tests makes it easier to fix based on warnings shown with e.g. valgrind closes https://github.com/official-stockfish/Stockfish/pull/5862 No functional change --- tests/testing.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/testing.py b/tests/testing.py index bc1f6b15..3a4b537e 100644 --- a/tests/testing.py +++ b/tests/testing.py @@ -97,14 +97,17 @@ class Syzygy: tarball_path = os.path.join(tmpdirname, f"{file}.tar.gz") response = requests.get(url, stream=True) - with open(tarball_path, 'wb') as f: + with open(tarball_path, "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) with tarfile.open(tarball_path, "r:gz") as tar: tar.extractall(tmpdirname) - shutil.move(os.path.join(tmpdirname, file), os.path.join(PATH, "syzygy")) + shutil.move( + os.path.join(tmpdirname, file), os.path.join(PATH, "syzygy") + ) + class OrderedClassMembers(type): @classmethod @@ -307,7 +310,10 @@ class Stockfish: text=True, ) - self.process.stdout + if self.process.returncode != 0: + print(self.process.stdout) + print(self.process.stderr) + print(f"Process failed with return code {self.process.returncode}") return