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

Partial #7247 reply with full run_log in error exit in pkunit #7291

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion sirepo/pkcli/job_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _do_compute(msg, template):
stderr=run_log,
)

if pkconfig.in_dev_mode() and pkunit.is_test_run():
if _in_pkunit():
sys.stderr.write(pkio.read_text(msg.runDir.join(template_common.RUN_LOG)))
status = None
while True:
Expand Down Expand Up @@ -350,6 +350,10 @@ def _file_reply(resp, msg):
return job.ok_reply()


def _in_pkunit():
return pkconfig.in_dev_mode() and pkunit.is_test_run()


def _maybe_parse_user_alert(exception, error=None):
e = error or str(exception)
if isinstance(exception, sirepo.util.UserAlert):
Expand Down Expand Up @@ -392,6 +396,8 @@ def _success_exit():


def _parse_python_errors(text):
if _in_pkunit():
return text
m = re.search(
r"^Traceback .*?^\w*(?:Error|Exception):\s*(.*)",
text,
Expand Down
Loading