Skip to content

Commit

Permalink
Show stdout/stderr in CI/CD tests
Browse files Browse the repository at this point in the history
makes it easier to fix based on warnings shown with e.g. valgrind

closes #5862

No functional change
  • Loading branch information
Disservin authored and vondele committed Feb 5, 2025
1 parent 2a5b41f commit 4c6d2bf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,17 @@ def download_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
Expand Down Expand Up @@ -307,7 +310,10 @@ def start(self):
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

Expand Down

0 comments on commit 4c6d2bf

Please sign in to comment.