Skip to content

Commit d3efbe4

Browse files
solomonneascodex
andauthored
fix(ci): accept SessionFind command-list help (#393)
Co-authored-by: Codex <codex@openai.com>
1 parent 32f6c1b commit d3efbe4

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

scripts/published-artifact-acceptance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def smoke_managed_components(
157157

158158
run_checked([managed_paths["miseledger"], "version"], runner=runner, env=env)
159159
sessionfind = run_checked([managed_paths["sessionfind"], "--help"], runner=runner, env=env)
160-
if "usage" not in f"{sessionfind.stdout}{sessionfind.stderr}".lower():
160+
if "usage" not in f"{sessionfind.stdout}{sessionfind.stderr}".lower() and not any(
161+
line.strip().startswith("sessionfind ") for line in sessionfind.stdout.splitlines()
162+
):
161163
raise AcceptanceError("sessionfind smoke produced no help text")
162164

163165

tests/test_published_artifact_acceptance.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,41 @@ def runner(argv, **kwargs):
204204
assert {Path(argv[0]).name for argv in calls} == set(acceptance_module.COMPONENT_IDS)
205205

206206

207+
def test_smoke_accepts_sessionfind_command_list_help(acceptance_module, tmp_path):
208+
managed_bin = tmp_path / "xdg-data" / "brigade" / "bin"
209+
_write_managed_binaries(managed_bin)
210+
211+
def runner(argv, **kwargs):
212+
if Path(argv[0]).name == "graphtrail-mcp":
213+
return subprocess.CompletedProcess(argv, 0, '{"jsonrpc":"2.0","id":1,"result":{}}', "")
214+
if Path(argv[0]).name == "sessionfind":
215+
return subprocess.CompletedProcess(argv, 0, "\n sessionfind query [PATH]...\n", "")
216+
return subprocess.CompletedProcess(argv, 0, "ok", "")
217+
218+
acceptance_module.smoke_managed_components(
219+
{component_id: managed_bin / component_id for component_id in acceptance_module.COMPONENT_IDS},
220+
runner=runner,
221+
)
222+
223+
224+
def test_smoke_rejects_sessionfind_unrelated_success_output(acceptance_module, tmp_path):
225+
managed_bin = tmp_path / "xdg-data" / "brigade" / "bin"
226+
_write_managed_binaries(managed_bin)
227+
228+
def runner(argv, **kwargs):
229+
if Path(argv[0]).name == "graphtrail-mcp":
230+
return subprocess.CompletedProcess(argv, 0, '{"jsonrpc":"2.0","id":1,"result":{}}', "")
231+
if Path(argv[0]).name == "sessionfind":
232+
return subprocess.CompletedProcess(argv, 0, "commands available", "no help text")
233+
return subprocess.CompletedProcess(argv, 0, "ok", "")
234+
235+
with pytest.raises(acceptance_module.AcceptanceError, match="sessionfind smoke produced no help text"):
236+
acceptance_module.smoke_managed_components(
237+
{component_id: managed_bin / component_id for component_id in acceptance_module.COMPONENT_IDS},
238+
runner=runner,
239+
)
240+
241+
207242
def test_poison_binary_invocation_is_a_failure(acceptance_module, tmp_path):
208243
marker = tmp_path / "poison-invoked"
209244
marker.write_text("graphtrail\n")

0 commit comments

Comments
 (0)