@@ -24,16 +24,12 @@ def _run_pytest_host(pytest_target: str) -> int:
2424 return proc .returncode
2525
2626
27- def _build_docker_image (dockerfile_path : str , image_tag : str , platform : str | None = None ) -> bool :
27+ def _build_docker_image (dockerfile_path : str , image_tag : str ) -> bool :
2828 context_dir = os .path .dirname (dockerfile_path )
2929 print (f"Building Docker image '{ image_tag } ' from { dockerfile_path } ..." )
3030 try :
31- cmd = ["docker" , "build" ]
32- if platform :
33- cmd += ["--platform" , platform ]
34- cmd += ["-t" , image_tag , "-f" , dockerfile_path , context_dir ]
3531 proc = subprocess .run (
36- cmd ,
32+ [ "docker" , "build" , "-t" , image_tag , "-f" , dockerfile_path , context_dir ] ,
3733 stdout = subprocess .PIPE ,
3834 stderr = subprocess .STDOUT ,
3935 text = True ,
@@ -45,7 +41,7 @@ def _build_docker_image(dockerfile_path: str, image_tag: str, platform: str | No
4541 return False
4642
4743
48- def _run_pytest_in_docker (project_root : str , image_tag : str , pytest_target : str , platform : str | None = None ) -> int :
44+ def _run_pytest_in_docker (project_root : str , image_tag : str , pytest_target : str ) -> int :
4945 workdir = "/workspace"
5046 # Mount read-only is safer; but tests may write artifacts. Use read-write.
5147 cmd = [
@@ -55,14 +51,10 @@ def _run_pytest_in_docker(project_root: str, image_tag: str, pytest_target: str,
5551 "-v" ,
5652 f"{ project_root } :{ workdir } " ,
5753 "-e" ,
58- f"HOME={ workdir } " ,
59- "-e" ,
6054 f"EVAL_PROTOCOL_DIR={ workdir } /.eval_protocol" ,
6155 "-w" ,
6256 workdir ,
6357 ]
64- if platform :
65- cmd += ["--platform" , platform ]
6658 # Try to match host user to avoid permission problems on mounted volume
6759 try :
6860 uid = os .getuid () # type: ignore[attr-defined]
@@ -142,19 +134,15 @@ def local_test_command(args: argparse.Namespace) -> int:
142134 os .makedirs (os .path .join (project_root , ".eval_protocol" ), exist_ok = True )
143135 except Exception :
144136 pass
145- # Choose platform to emulate Linux host (default to amd64 on macOS, override with EP_DOCKER_PLATFORM)
146- selected_platform = os .environ .get ("EP_DOCKER_PLATFORM" )
147- if not selected_platform and sys .platform == "darwin" :
148- selected_platform = "linux/amd64"
149137 image_tag = "ep-evaluator:local"
150- ok = _build_docker_image (dockerfiles [0 ], image_tag , platform = selected_platform )
138+ ok = _build_docker_image (dockerfiles [0 ], image_tag )
151139 if not ok :
152140 print ("Docker build failed. See logs above." )
153141 return 1
154142 if not pytest_target :
155143 print ("Error: Failed to resolve a pytest target to run." )
156144 return 1
157- return _run_pytest_in_docker (project_root , image_tag , pytest_target , platform = selected_platform )
145+ return _run_pytest_in_docker (project_root , image_tag , pytest_target )
158146
159147 # No Dockerfile: run on host
160148 if not pytest_target :
0 commit comments