Skip to content

Commit

Permalink
Partial #7247 reply with full run_log in error exit in pkunit
Browse files Browse the repository at this point in the history
  • Loading branch information
robnagler committed Sep 26, 2024
1 parent c3d2c2c commit 6c6350f
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 6c6350f

Please sign in to comment.