Skip to content

chore(ai): update tests/AGENTS.md, add pytest-vcr skill and add ENABLE_VERTEX flag for better ergonomics#4211

Open
dsfaccini wants to merge 46 commits intomainfrom
david-claude-md-changes
Open

chore(ai): update tests/AGENTS.md, add pytest-vcr skill and add ENABLE_VERTEX flag for better ergonomics#4211
dsfaccini wants to merge 46 commits intomainfrom
david-claude-md-changes

Conversation

@dsfaccini
Copy link
Copy Markdown
Collaborator

@dsfaccini dsfaccini commented Feb 5, 2026

Adds testing infrastructure and documentation to help AI coding agents work effectively in this repository.

Pre-Review Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • Linting and type checking pass per make format and make typecheck.
  • PR title is fit for the release changelog.

Pre-Merge Checklist

  • New tests for any fix or new behavior, maintaining 100% coverage.
  • Updated documentation for new features and behaviors, including docstrings for API docs.

Changes Made

  • tests/AGENTS.md: Testing guidelines covering test file structure, parametrization patterns, the model fixture, VCR cassette workflow, key fixtures (allow_model_requests, env, binary content, SSRF protection), assertion helpers (IsNow, IsStr, IsSameStr, etc.), directory layout, and curated rules extracted from PR review patterns.
  • .agents/skills/pytest-vcr/SKILL.md: A skill for recording, rewriting, and debugging VCR cassettes, with step-by-step instructions for common workflows and provider-specific auth notes (supporting GOOGLE_APPLICATION_CREDENTIALS, service accounts, and ADC for Vertex).
  • .agents/skills/pytest-vcr/parse_cassette.py: Helper script to parse and display cassette contents in a readable format.
  • tests/conftest.py:
    • _guard_ssrf_in_vcr_tests: autouse fixture that raises a clear error if a VCR test triggers SSRF validation without the disable_ssrf_protection_for_vcr fixture.
    • skip_unless_vertex / updated vertex_provider: allows local Vertex tests when ENABLE_VERTEX=1 is set (previously required CI or manually commenting out a line).

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

devin-ai-integration[bot]

This comment was marked as resolved.

@dsfaccini dsfaccini added chore test-suite Changes or improvements to the test suite better ai improvements to infra that aids ai coding agents in developing pydantic-ai (and with - pydantic-ai) labels Feb 5, 2026
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

Docs Preview

commit: d1129c7
Preview URL: https://65e6f484-pydantic-ai-previews.pydantic.workers.dev

devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

dsfaccini and others added 2 commits February 5, 2026 16:26
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

dsfaccini and others added 2 commits February 5, 2026 17:03
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.



@pytest.fixture(autouse=True)
def _guard_ssrf_in_vcr_tests(request: pytest.FixtureRequest):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DouweM asked above whether disable_ssrf_protection_for_vcr should just be autouse for all VCR tests. The author's response (explicit opt-in catches accidental URL downloads) makes sense to me, but this hasn't been acknowledged by a maintainer yet — worth confirming the approach before merging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

dsfaccini and others added 6 commits March 22, 2026 14:32
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…nges

# Conflicts:
#	.gitignore
#	tests/conftest.py
Remove opinionated Bedrock/Vertex auth scripts and SKILL.md vertex
section to reduce PR scope and ease merging. Fix .gitignore to properly
un-ignore .agents/skills/ parent directory so whitelisted skills are
tracked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…c-ai into david-claude-md-changes

# Conflicts:
#	.agents/skills/pytest-vcr/run-vertex-tests.sh
@dsfaccini
Copy link
Copy Markdown
Collaborator Author

@copilot please write a summary of what this PR does

Copy link
Copy Markdown

Copilot AI commented Mar 26, 2026

@copilot please write a summary of what this PR does

This PR adds testing infrastructure and documentation to help AI coding agents work effectively in this repo:

tests/AGENTS.md — Testing guidelines covering test file structure, parametrization patterns, VCR cassette workflow, key fixtures (model, allow_model_requests, env, binary content, SSRF protection), assertion helpers, and directory layout. Also includes curated rules extracted from PR review patterns.

.agents/skills/pytest-vcr/SKILL.md — A skill for recording, rewriting, and debugging VCR cassettes, with step-by-step instructions for common workflows and provider-specific auth notes.

.agents/skills/pytest-vcr/parse_cassette.py — Helper script to parse and display cassette contents in a readable format.

tests/conftest.py — Two additions:

  • _guard_ssrf_in_vcr_tests: autouse fixture that raises a clear error if a VCR test triggers SSRF validation without opting in to disable_ssrf_protection_for_vcr
  • skip_unless_vertex / updated vertex_provider: allows local Vertex tests when ENABLE_VERTEX=1 is set (previously required CI or commenting out a line)

@dsfaccini
Copy link
Copy Markdown
Collaborator Author

additional to copilot's comments, this PR symlinks .claude/ to .agents/ and adds a CI check so PR's don't accidentally remove the symlink

@dsfaccini dsfaccini changed the title chore(ai): add testing instructions and skill chore(ai): update tests/AGENTS.md, add pytest-vcr skill and add ENABLE_VERTEX flag for better ergonomics Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

better ai improvements to infra that aids ai coding agents in developing pydantic-ai (and with - pydantic-ai) chore size: M Medium PR (101-500 weighted lines) test-suite Changes or improvements to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants