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

combined redundant logging messages #15

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions gaps/cli/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ def _kickoff_hpc_job(ctx, cmd, hardware_option, **kwargs):

name = ctx.obj["NAME"]
command = ctx.obj["COMMAND_NAME"]
logger.info("Running %r on HPC with job name %r.", command, name)
logger.debug("Submitting the following command:\n%s", cmd)
out = ctx.obj["MANAGER"].submit(name, cmd=cmd, **kwargs)[0]
id_msg = f" (Job ID #{out})" if out else ""
msg = f"Kicked off job {name!r}{id_msg}"
msg = f"Kicked off {command!r} job {name!r}{id_msg}"

Status.mark_job_as_submitted(
ctx.obj["OUT_DIR"],
Expand Down
7 changes: 3 additions & 4 deletions tests/cli/test_cli_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,13 @@ def _test_submit(cmd):
kickoff_job(test_ctx, cmd, exec_kwargs)
test_ctx.obj.pop("MANAGER", None)

assert len(cmd_cache) == 2
assert len(cmd_cache) >= 1, str(cmd_cache)
assert_message_was_logged(
"Found extra keys in 'execution_control'! ", "WARNING"
)
assert_message_was_logged("dne_arg", "WARNING")
assert_message_was_logged("Running 'run' on HPC with job name", "INFO")
assert_message_was_logged(test_ctx.obj["NAME"], "INFO")
assert_message_was_logged("Kicked off job")
assert_message_was_logged(test_ctx.obj["NAME"])
assert_message_was_logged("Kicked off ")
assert_message_was_logged("(Job ID #9999)", clear_records=True)
assert len(list(test_ctx.obj["TMP_PATH"].glob("*"))) == 2

Expand Down
Loading