Skip to content

Commit e7615d7

Browse files
committed
mount for ep logs
1 parent cd9cc91 commit e7615d7

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

eval_protocol/cli_commands/local_test.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,19 @@ def _run_pytest_in_docker(project_root: str, image_tag: str, pytest_target: str)
5050
"--rm",
5151
"-v",
5252
f"{project_root}:{workdir}",
53+
"-e",
54+
f"EVAL_PROTOCOL_DIR={workdir}/.eval_protocol",
5355
"-w",
5456
workdir,
55-
image_tag,
56-
"pytest",
57-
pytest_target,
58-
"-vs",
5957
]
58+
# Try to match host user to avoid permission problems on mounted volume
59+
try:
60+
uid = os.getuid() # type: ignore[attr-defined]
61+
gid = os.getgid() # type: ignore[attr-defined]
62+
cmd += ["--user", f"{uid}:{gid}"]
63+
except Exception:
64+
pass
65+
cmd += [image_tag, "pytest", pytest_target, "-vs"]
6066
print("Running in Docker:", " ".join(cmd))
6167
try:
6268
proc = subprocess.run(cmd)
@@ -123,6 +129,11 @@ def local_test_command(args: argparse.Namespace) -> int:
123129
print("Hint: use --ignore-docker to bypass Docker.")
124130
return 1
125131
if len(dockerfiles) == 1:
132+
# Ensure shared logs directory exists on host so container writes are visible to host ep logs
133+
try:
134+
os.makedirs(os.path.join(project_root, ".eval_protocol"), exist_ok=True)
135+
except Exception:
136+
pass
126137
image_tag = "ep-evaluator:local"
127138
ok = _build_docker_image(dockerfiles[0], image_tag)
128139
if not ok:

eval_protocol/cli_commands/upload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _prompt_select_interactive(tests: list[DiscoveredTest]) -> list[DiscoveredTe
437437
# Check if only one test - auto-select it
438438
if len(tests) == 1:
439439
print(f"\nFound 1 test: {_format_test_choice(tests[0], 1)}")
440-
confirm = questionary.confirm("Upload this test?", default=True, style=custom_style).ask()
440+
confirm = questionary.confirm("Select this test?", default=True, style=custom_style).ask()
441441
if confirm:
442442
return tests
443443
else:
@@ -500,7 +500,7 @@ def _prompt_select_fallback(tests: list[DiscoveredTest]) -> list[DiscoveredTest]
500500

501501
print("=" * 80)
502502
try:
503-
choice = input("Enter the number to upload: ").strip()
503+
choice = input("Enter the number to select: ").strip()
504504
except KeyboardInterrupt:
505505
print("\n\nUpload cancelled.")
506506
return []

0 commit comments

Comments
 (0)