Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heading line before printing error message for 'buildtest build' #1643

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions buildtest/builders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,17 @@ def run(self, cmd, timeout=None):

self.logger.debug(f"Running Test via command: {cmd}")
ret = command.returncode()
err_msg = " ".join(command.get_error())
err_msg = command.get_error()
# limit error messages to 60 lines
if len(err_msg) >= 60:
err_msg = err_msg[-60:]

if not self._retry or ret == 0:
return command

err = f"{self} failed to submit job with returncode: {ret} \n"
console.print(f"[red]{err}")
console.print(f"[red]{err_msg}")
console.print(f"[red]{self} failed to submit job with returncode: {ret}")
console.rule(f"[red]Error Message for {self}")
console.print(f"[red]{' '.join(err_msg)}")

########## Retry for failed tests ##########

Expand All @@ -401,8 +404,7 @@ def run(self, cmd, timeout=None):
# if we recieve a returncode of 0 return immediately with the instance of command
if ret == 0:
return command
err = f"{self}: failed to submit job with returncode: {ret} "
console.print(f"[red]{err}")
console.print(f"[red]{self}: failed to submit job with returncode: {ret}")

return command

Expand Down
Loading