test(integration): update test_tier3_integration to align with global config-home convention
This commit is contained in:
@@ -63,7 +63,7 @@ def test_integration_create_options_combination(mam_sandbox, mock_herdr, mock_ag
|
||||
session = sessions[0]
|
||||
|
||||
assert session["role"] == "Creator"
|
||||
assert session.get("herdr_session") == "custom_server"
|
||||
assert session.get("herdr_server") == "custom_server"
|
||||
assert session["delegate_job_id"] is not None
|
||||
assert session["status"] == "running"
|
||||
|
||||
@@ -98,26 +98,20 @@ def test_integration_stop_purge_combination(mam_sandbox, mock_herdr, mock_agents
|
||||
res_create = subprocess.run(cmd_create, capture_output=True, text=True, cwd=str(tmp_path))
|
||||
assert res_create.returncode == 0, f"Stdout: {res_create.stdout}\nStderr: {res_create.stderr}"
|
||||
|
||||
# Get session name and isolation uuid
|
||||
# Get session name and claude session uuid
|
||||
yaml_path = tmp_path / ".mam" / "agent-sessions.yaml"
|
||||
with open(yaml_path, 'r') as f:
|
||||
reg = yaml.safe_load(f)
|
||||
session = reg["herdr_sessions"][0]
|
||||
session_name = session["name"]
|
||||
iso_uuid = session["isolation"]["uuid"]
|
||||
iso_root = Path(session["isolation"]["root"])
|
||||
|
||||
# Ensure isolation home root folder is provisioned
|
||||
assert iso_root.exists()
|
||||
claude_uuid = session["claude_session_id_own"]
|
||||
|
||||
# Locate dynamically generated conversation file in claude projects
|
||||
key = str(tmp_path).replace('/', '-').replace('_', '-')
|
||||
proj_dir = iso_root / "projects" / key
|
||||
assert proj_dir.exists(), f"Expected isolated projects directory {proj_dir} to exist"
|
||||
proj_dir = tmp_path / ".claude" / "projects" / key
|
||||
assert proj_dir.exists(), f"Expected projects directory {proj_dir} to exist"
|
||||
|
||||
jsonls = list(proj_dir.glob("*.jsonl"))
|
||||
assert len(jsonls) == 1, f"Expected exactly 1 jsonl file in {proj_dir}, found {jsonls}"
|
||||
jsonl_file = jsonls[0]
|
||||
jsonl_file = proj_dir / f"{claude_uuid}.jsonl"
|
||||
assert jsonl_file.exists()
|
||||
|
||||
# Update mock herdr's state to match the running agent so the stop kill-chain works gracefully
|
||||
@@ -147,7 +141,6 @@ def test_integration_stop_purge_combination(mam_sandbox, mock_herdr, mock_agents
|
||||
assert "DANGER: --purge-conversation" in res_stop_no_yes.stdout
|
||||
|
||||
# Ensure nothing was deleted yet
|
||||
assert iso_root.exists()
|
||||
assert jsonl_file.exists()
|
||||
|
||||
# 3. Run stop_session with --yes
|
||||
@@ -161,8 +154,6 @@ def test_integration_stop_purge_combination(mam_sandbox, mock_herdr, mock_agents
|
||||
assert res_stop_yes.returncode == 0, f"Stdout: {res_stop_yes.stdout}\nStderr: {res_stop_yes.stderr}"
|
||||
|
||||
# Assertions:
|
||||
# - Isolation directory deleted
|
||||
assert not iso_root.exists()
|
||||
# - Conversation files deleted
|
||||
assert not jsonl_file.exists()
|
||||
# - Session completely removed from YAML/DB registry
|
||||
|
||||
Reference in New Issue
Block a user