Skip to content

Commit 965cb0c

Browse files
test(compat): validate ADK requests against a window of server contracts
Generalizes the #405 regression guard. Captures the requests the ADK emits (states.create/update for v1) and validates each against a window of supported server OpenAPI contracts vendored under tests/compat/server_specs/: `current` (scale-agentex main) and `min-supported` (pre-#278, which still requires task_id/agent_id in the state body). Catches the 0.13.0 class of break — a client that drops a field an older deployed server still requires. Verified: with the field-drop, states.update fails "task_id/agent_id required" against min-supported while passing current. Specs are vendored for deterministic CI (no network); refresh_specs.py re-pulls them at the SHAs in manifest.json. Advance min-supported as the oldest deployed server moves forward; extend _OPERATIONS for more ADK operations. Stacked on #405 (needs the extra_body fix so states.update passes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9110115 commit 965cb0c

6 files changed

Lines changed: 13684 additions & 0 deletions

File tree

tests/compat/__init__.py

Whitespace-only changes.

tests/compat/refresh_specs.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Re-vendor the server OpenAPI specs at the SHAs pinned in manifest.json.
2+
Usage: `python tests/compat/refresh_specs.py` (needs `gh` auth for the source repo)."""
3+
4+
from __future__ import annotations
5+
6+
import json
7+
import subprocess
8+
from pathlib import Path
9+
10+
_DIR = Path(__file__).parent / "server_specs"
11+
12+
13+
def main() -> None:
14+
manifest = json.loads((_DIR / "manifest.json").read_text())
15+
repo, path = manifest["source_repo"], manifest["source_path"]
16+
for entry in manifest["specs"]:
17+
content = subprocess.run(
18+
[
19+
"gh",
20+
"api",
21+
f"repos/{repo}/contents/{path}?ref={entry['sha']}",
22+
"-H",
23+
"Accept: application/vnd.github.raw",
24+
],
25+
check=True,
26+
capture_output=True,
27+
text=True,
28+
).stdout
29+
(_DIR / entry["file"]).write_text(content)
30+
print(f"wrote {entry['file']} from {repo}@{entry['sha'][:12]}")
31+
32+
33+
if __name__ == "__main__":
34+
main()

0 commit comments

Comments
 (0)