Skip to content

docs: require reusing the existing Postgres test harness - #374

Open
aivong-openhands wants to merge 2 commits into
mainfrom
docs/agents-postgres-harness-guidance
Open

aivong-openhands wants to merge 2 commits into
mainfrom
docs/agents-postgres-harness-guidance

Conversation

@aivong-openhands

@aivong-openhands aivong-openhands commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

  • A human has tested these changes.

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-root conftest.py starts for every pytest session — surfacing in CI as ModuleNotFoundError: No module named 'testcontainers'. Porting the tests onto the existing async_session_maker fixture removed the parallel harness. This adds a directive to the Database Testing section of AGENTS.md so agents reuse the shared fixtures — and justify any exception in the PR — rather than repeat the mistake.

Summary

  • Adds a bullet to AGENTS.md requiring agents to use the existing testcontainers fixtures before building any parallel Postgres harness, naming the anti-patterns to avoid (a GitHub Actions services: container, a POSTGRES_TEST_DATABASE_URL DSN, 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

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

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:

ghcr.io/openhands/enterprise-server:sha-a6e0abd

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>
@github-actions github-actions Bot added the type: docs Documentation only changes label Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@aivong-openhands
aivong-openhands marked this pull request as ready for review September 12, 2026 23:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: docs Documentation only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant