Skip to content

feat(testing): forward pre_validation_hooks through build_asgi_app#655

Merged
bokelley merged 2 commits into
mainfrom
claude/issue-651-build-asgi-app-pre-validation-hooks-v2
May 11, 2026
Merged

feat(testing): forward pre_validation_hooks through build_asgi_app#655
bokelley merged 2 commits into
mainfrom
claude/issue-651-build-asgi-app-pre-validation-hooks-v2

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #651

Summary

build_asgi_app and build_test_client were missing pre_validation_hooks from their signatures. Because create_mcp_server already accepts this parameter, in-process ASGI tests silently got a different validation surface than production serve() calls — pre-v3 buyer payloads that serve(pre_validation_hooks=...) would coerce were rejected by build_asgi_app-driven tests, causing false-red test failures and false-green production gaps.

This PR adds pre_validation_hooks: dict[str, Callable[..., Any]] | None = None to both helpers and forwards it to the existing create_mcp_server call. No change to internals — pure forwarding, fully backwards-compatible.

What was tested

  • pytest tests/test_testing_decisioning.py tests/test_pre_validation_hooks.py41 passed
  • pytest tests/ -k "not test_real_tls" --ignore=tests/integration4318 passed (TLS test is a pre-existing network-dependent failure unrelated to this change)
  • ruff check src/adcp/testing/decisioning.py → all checks passed
  • mypy src/adcp/testing/ → no new errors

Pre-PR review

  • code-reviewer: approved — no blockers; 1 nit fixed (dropped dead hook_calls variable from smoke test)
  • dx-expert: approved — no blockers; 1 nit fixed (same)

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01H8Trwexkgv1VyFJwDdZMoa


Generated by Claude Code

claude added 2 commits May 11, 2026 07:16
build_asgi_app and build_test_client now accept pre_validation_hooks and
forward it to create_mcp_server, so in-process ASGI tests see the same
coercion surface as production serve() calls.

Closes #651
https://claude.ai/code/session_01H8Trwexkgv1VyFJwDdZMoa
@bokelley bokelley marked this pull request as ready for review May 11, 2026 07:41
@bokelley bokelley merged commit 2df49c0 into main May 11, 2026
16 checks passed
@bokelley bokelley deleted the claude/issue-651-build-asgi-app-pre-validation-hooks-v2 branch May 11, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(testing): forward pre_validation_hooks through build_asgi_app (follow-up to #626)

2 participants