Skip to content

Commit 75d4cb6

Browse files
committed
try
1 parent 99169ab commit 75d4cb6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

eval_protocol/cli_commands/local_test.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,26 @@ def _build_docker_image(dockerfile_path: str, image_tag: str) -> bool:
4343

4444
def _run_pytest_in_docker(project_root: str, image_tag: str, pytest_target: str) -> int:
4545
workdir = "/workspace"
46+
# Host HOME logs directory to map into container
47+
host_home = os.path.expanduser("~")
48+
host_logs_dir = os.path.join(host_home, ".eval_protocol")
49+
try:
50+
os.makedirs(host_logs_dir, exist_ok=True)
51+
except Exception:
52+
pass
4653
# Mount read-only is safer; but tests may write artifacts. Use read-write.
4754
cmd = [
4855
"docker",
4956
"run",
5057
"--rm",
5158
"-v",
5259
f"{project_root}:{workdir}",
60+
"-v",
61+
f"{host_logs_dir}:/container_home/.eval_protocol",
5362
"-e",
54-
f"HOME={workdir}",
63+
"HOME=/container_home",
5564
"-e",
56-
f"EVAL_PROTOCOL_DIR={workdir}/.eval_protocol",
65+
"EVAL_PROTOCOL_DIR=/container_home/.eval_protocol",
5766
"-w",
5867
workdir,
5968
]
@@ -131,9 +140,9 @@ def local_test_command(args: argparse.Namespace) -> int:
131140
print("Hint: use --ignore-docker to bypass Docker.")
132141
return 1
133142
if len(dockerfiles) == 1:
134-
# Ensure shared logs directory exists on host so container writes are visible to host ep logs
143+
# Ensure host home logs directory exists so container writes are visible to host ep logs
135144
try:
136-
os.makedirs(os.path.join(project_root, ".eval_protocol"), exist_ok=True)
145+
os.makedirs(os.path.join(os.path.expanduser("~"), ".eval_protocol"), exist_ok=True)
137146
except Exception:
138147
pass
139148
image_tag = "ep-evaluator:local"

0 commit comments

Comments
 (0)