Skip to content

feat: move Postgres family to clientless validation - #142

Open
cofin wants to merge 3 commits into
feat/provider-aware-cifrom
feat/clientless-postgres-family
Open

feat: move Postgres family to clientless validation#142
cofin wants to merge 3 commits into
feat/provider-aware-cifrom
feat/clientless-postgres-family

Conversation

@cofin

@cofin cofin commented May 24, 2026

Copy link
Copy Markdown
Member

Drop psycopg from the pytest-databases[postgres] extra. The postgres, pgvector, paradedb, and alloydb_omni fixtures (and every per-version variant) now check readiness and create per-worker databases through the bundled psql CLI.

All bundled *_connection fixtures are removed. Users install their own psycopg client alongside pytest-databases and build connections from the service metadata.

_make_connection_string stays — it's a pure string formatter still imported elsewhere. The [postgres] extra is now empty; cockroachdb still pulls psycopg, and the dev extra group keeps psycopg[binary,pool].

@cofin
cofin force-pushed the feat/clientless-postgres-family branch from e313e78 to c51332f Compare July 21, 2026 17:13
@cofin
cofin changed the base branch from main to feat/provider-aware-ci July 21, 2026 18:51
@cofin
cofin force-pushed the feat/clientless-postgres-family branch 2 times, most recently from c442a11 to 2131efc Compare July 22, 2026 05:08
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 31 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feat/provider-aware-ci@f0b2684). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/pytest_databases/docker/postgres.py 0.00% 31 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##             feat/provider-aware-ci    #142   +/-   ##
========================================================
  Coverage                          ?   6.43%           
========================================================
  Files                             ?      22           
  Lines                             ?    1724           
  Branches                          ?     139           
========================================================
  Hits                              ?     111           
  Misses                            ?    1590           
  Partials                          ?      23           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cofin added 3 commits July 22, 2026 15:56
Drop the runtime psycopg dependency from the postgres extra. The
PostgresService fixtures now validate readiness and create the per-worker
database through `psql` invoked via container.exec_run, and the bundled
*_connection fixtures (postgres, pgvector, paradedb, alloydb_omni) are
removed. Users install their own psycopg client alongside
pytest-databases[postgres].

The _make_connection_string helper stays — cockroachdb tests still import
it as a pure string formatter.
The postgres official image runs a two-phase boot: phase 1 listens on
the Unix socket only for initdb, phase 5 restarts with TCP listeners.
Calling psql without -h opportunistically uses the socket and the
readiness check could pass during phase 1, leaving _create_worker_database
to find the socket gone (or never present) after phase 5.

Pinning -h localhost -p 5432 forces psql onto the same TCP transport
user code uses, so readiness ≡ "TCP ready". Surfaced as a flaky
postgres_14_service failure on the Python 3.14 shard.
@cofin
cofin force-pushed the feat/clientless-postgres-family branch from 2131efc to 61d52a8 Compare July 22, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants