Skip to content

Commit efc7fb3

Browse files
committed
fix docker running error exit
1 parent 69f5064 commit efc7fb3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

commit0/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def main() -> None:
2020
)
2121
# type check config values
2222
cs = ConfigStore.instance()
23-
cs.store(name="user", node=Commit0Config)
23+
cs.store(name="user", group="Commit0Config", node=Commit0Config)
2424
# have hydra to ignore all command-line arguments
2525
sys_argv = copy.deepcopy(sys.argv)
2626
sys.argv = [sys.argv[0]]

commit0/harness/run_pytest_ids.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import traceback
66
from pathlib import Path
77
import logging
8-
8+
import sys
99
from typing import Iterator
1010
from git import Repo
1111
from commit0.harness.constants import RUN_PYTEST_LOG_DIR, RepoInstance
@@ -108,6 +108,7 @@ def run_docker(
108108
assert container is not None
109109
cleanup_container(client, container, logger)
110110
close_logger(logger)
111+
return test_output
111112

112113

113114
def run_modal(
@@ -254,10 +255,14 @@ def main(
254255
eval_file.write_text(eval_script)
255256

256257
if ExecutionBackend(backend) == ExecutionBackend.LOCAL:
257-
run_docker(spec, logger, eval_file, timeout, log_dir, stdout)
258+
exit_error_message = run_docker(
259+
spec, logger, eval_file, timeout, log_dir, stdout
260+
)
258261
elif ExecutionBackend(backend) == ExecutionBackend.MODAL:
259262
run_modal(spec, logger, eval_file, timeout, log_dir, stdout)
260-
return str(log_dir)
263+
264+
if exit_error_message:
265+
sys.exit(exit_error_message)
261266

262267

263268
__all__ = []

0 commit comments

Comments
 (0)