@@ -16,17 +16,6 @@ def tmp_workdir(tmp_path: Path) -> Path:
1616 return tmp_path
1717
1818
19- def run_setup (* extra_args : str , cwd : str | None = None ) -> subprocess .CompletedProcess :
20- """Run setup-closedloop.sh with the given extra arguments."""
21- workdir = cwd or str (extra_args [0 ]) if extra_args else "."
22- return subprocess .run (
23- ["bash" , str (SETUP_SCRIPT ), workdir , * extra_args ],
24- capture_output = True ,
25- text = True ,
26- cwd = cwd or workdir ,
27- )
28-
29-
3019def _run_setup_in_workdir (
3120 workdir : Path , * extra_args : str , cwd : str | None = None
3221) -> subprocess .CompletedProcess :
@@ -86,13 +75,6 @@ def test_plan_relative_path_resolves_to_absolute(tmp_workdir: Path) -> None:
8675 pytest .fail ("CLOSEDLOOP_PLAN_FILE not found in stdout" )
8776
8877
89- def test_plan_missing_value_exits_error (tmp_workdir : Path ) -> None :
90- """Should fail when --plan flag is given with no following value."""
91- result = _run_setup_in_workdir (tmp_workdir , "--plan" )
92-
93- assert result .returncode != 0
94-
95-
9678def test_plan_skips_prd_autodiscovery (tmp_workdir : Path ) -> None :
9779 """Should not auto-discover prd.md when --plan is specified."""
9880 # Write a prd.md that would normally be auto-discovered
@@ -160,13 +142,6 @@ def _config_env(workdir: Path) -> str:
160142 return (workdir / ".closedloop" / "config.env" ).read_text ()
161143
162144
163- def test_add_dir_valid_directory_succeeds (tmp_workdir : Path , extra_repo : Path ) -> None :
164- """Should succeed when --add-dir points to an existing directory."""
165- result = _run_setup_in_workdir (tmp_workdir , "--add-dir" , str (extra_repo ))
166-
167- assert result .returncode == 0 , result .stderr
168-
169-
170145def test_add_dir_nonexistent_path_fails (tmp_workdir : Path ) -> None :
171146 """Should exit non-zero when --add-dir path does not exist."""
172147 result = _run_setup_in_workdir (tmp_workdir , "--add-dir" , "/nonexistent/path/does/not/exist" )
@@ -185,17 +160,6 @@ def test_add_dir_writes_closedloop_add_dirs_to_config(tmp_workdir: Path, extra_r
185160 assert "CLOSEDLOOP_ADD_DIRS=" in config
186161
187162
188- def test_add_dir_writes_closedloop_add_dir_names_to_config (tmp_workdir : Path , extra_repo : Path ) -> None :
189- """config.env must contain CLOSEDLOOP_ADD_DIR_NAMES derived from directory basename."""
190- result = _run_setup_in_workdir (tmp_workdir , "--add-dir" , str (extra_repo ))
191-
192- assert result .returncode == 0 , result .stderr
193- config = _config_env (tmp_workdir )
194- assert "CLOSEDLOOP_ADD_DIR_NAMES=" in config
195- # basename of extra_repo is "extra-repo"
196- assert "extra-repo" in config
197-
198-
199163def test_add_dir_writes_closedloop_repo_map_to_config (tmp_workdir : Path , extra_repo : Path ) -> None :
200164 """config.env must contain CLOSEDLOOP_REPO_MAP in name=path format."""
201165 result = _run_setup_in_workdir (tmp_workdir , "--add-dir" , str (extra_repo ))
@@ -222,18 +186,6 @@ def test_add_dir_uses_identity_file_name(tmp_workdir: Path, tmp_path: Path) -> N
222186 assert "my-custom-name" in config
223187
224188
225- def test_add_dir_falls_back_to_basename_when_no_identity (tmp_workdir : Path , tmp_path : Path ) -> None :
226- """Should use basename when .repo-identity.json is absent."""
227- unnamed_repo = tmp_path / "unnamed-service"
228- unnamed_repo .mkdir ()
229-
230- result = _run_setup_in_workdir (tmp_workdir , "--add-dir" , str (unnamed_repo ))
231-
232- assert result .returncode == 0 , result .stderr
233- config = _config_env (tmp_workdir )
234- assert "unnamed-service" in config
235-
236-
237189def test_multiple_add_dirs_produces_pipe_joined_values (tmp_workdir : Path , tmp_path : Path ) -> None :
238190 """Multiple --add-dir flags should produce pipe-separated values in config.env."""
239191 repo_a = tmp_path / "repo-a"
0 commit comments