Skip to content

Commit 27b7a46

Browse files
committed
test(e2e): fix _agent_api_url regression in suite23; isolate suite26 credential tests
- suite23: build the respond URL via runtime.client._agent_url() (the removed runtime._agent_api_url helper). - suite26: function-scoped runtime fixture so each credential test re-registers the worker TaskDef (with overwrite), making TaskDef.runtimeMetadata reflect the test's own code path instead of a value left by a prior test in the module. Verified via fail-first mutation: removing the registration stamping now fails both credential tests together (previously the module-scoped runtime masked it).
1 parent a84638d commit 27b7a46

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

e2e/test_suite23_from_instance_and_event_hitl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_event_without_execution_id_raises(self):
200200

201201
def test_respond_url_matches_server_wire_format(self, runtime):
202202
"""The respond URL is /api/agent/{executionId}/respond (Java parity)."""
203-
url = runtime._agent_api_url(f"/{self.SUB_EXEC}/respond")
203+
url = runtime.client._agent_url(f"/{self.SUB_EXEC}/respond")
204204
assert url.endswith(f"/agent/{self.SUB_EXEC}/respond"), (
205205
f"respond must POST to /api/agent/{{id}}/respond; got {url!r}."
206206
)

e2e/test_suite26_worker_credentials.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@
3939
_BASE = _API.replace("/api", "")
4040

4141

42+
@pytest.fixture()
43+
def runtime():
44+
"""Function-scoped runtime (overrides the module-scoped conftest fixture).
45+
46+
Each test gets a fresh runtime so it re-registers the worker TaskDef (with
47+
overwrite) — making TaskDef.runtimeMetadata reflect *this* test's code path
48+
rather than a value left by a prior test in the module (the module-scoped
49+
runtime caches registered tool names and would otherwise skip re-registration,
50+
letting a stale/server-recompiled value mask a regression)."""
51+
from conductor.ai.agents import AgentRuntime
52+
53+
with AgentRuntime() as rt:
54+
yield rt
55+
56+
4257
# ── Tool: reports whether the declared secret was injected ───────────────
4358

4459

0 commit comments

Comments
 (0)