Repository navigation
docs: require reusing the existing Postgres test harness - #374
Open
aivong-openhands wants to merge 2 commits into
Open
aivong-openhands wants to merge 2 commits into
aivong-openhands wants to merge 2 commits into
Conversation
Add guidance to AGENTS.md's Database Testing section directing agents not to build a new Postgres test harness (a GitHub Actions services container, a POSTGRES_TEST_DATABASE_URL DSN, a separate CI workflow, or a schema hand-built from model metadata) before first using the shared testcontainers fixtures and confirming they do not fit the use case. Motivated by a recent change that added a parallel harness: it tested a model-derived schema instead of the migrated one and collided with the testcontainers Postgres the repo-root conftest.py starts for every session. Co-authored-by: openhands <openhands@all-hands.dev>
aivong-openhands
marked this pull request as ready for review
September 12, 2026 23:36
…harness-guidance # Conflicts: # AGENTS.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
AGENT:
Why
A recent incident (#337 → #369 → #371) traced back to a new test that stood up its own Postgres harness: it built the schema from model metadata instead of
alembic upgrade head, so it exercised a different schema than production, and it collided with the testcontainers Postgres the repo-rootconftest.pystarts for every pytest session — surfacing in CI asModuleNotFoundError: No module named 'testcontainers'. Porting the tests onto the existingasync_session_makerfixture removed the parallel harness. This adds a directive to the Database Testing section ofAGENTS.mdso agents reuse the shared fixtures — and justify any exception in the PR — rather than repeat the mistake.Summary
AGENTS.mdrequiring agents to use the existing testcontainers fixtures before building any parallel Postgres harness, naming the anti-patterns to avoid (a GitHub Actionsservices:container, aPOSTGRES_TEST_DATABASE_URLDSN, a separate CI workflow, a schema hand-built from model metadata) and requiring a stated reason in the PR when the shared harness genuinely cannot cover the case.Issue Number
#337, #369, #371
How to Test
Docs-only change to
AGENTS.md; there is nothing to run. The addition is a single bullet in the Database Testing section, visible in the diff.Video/Screenshots
N/A — documentation-only change.
Type
Notes
Docs-only; no code or tests affected.
This PR was drafted by an AI agent on behalf of the user.
Enterprise server image for this PR: