test(v2/postgres): add PgBouncer integration tests with CI job

Context

Follow-up to !363 (merged) which adds QueryExecModeSimpleProtocol as the default. This MR adds integration tests that verify the behavior against live PostgreSQL and PgBouncer instances.

Tracking issue: gitlab-org/quality/quality-engineering/team-tasks#4291 (closed) (task: "Test against a PgBouncer instance in CI or local dev setup")

What's in this MR?

  • Integration tests (integration_test.go) gated behind the integration build tag:
    • TestDirectPostgres_SimpleProtocol: default mode works against direct PostgreSQL
    • TestDirectPostgres_CacheStatement: prepared statements work without a pooler
    • TestPgBouncer_SimpleProtocol: default mode works through PgBouncer transaction pooling
    • TestPgBouncer_ParameterizedQuery: parameterized queries work through PgBouncer
  • docker-compose.yml for local development (PostgreSQL 16 + PgBouncer 1.23.1 in transaction mode)
  • CI job (test-integration:postgres) with PostgreSQL and PgBouncer as services using FF_NETWORK_PER_BUILD

Local usage

docker compose -f v2/postgres/testdata/docker-compose.yml up -d
go test -v -tags integration ./v2/postgres/
docker compose -f v2/postgres/testdata/docker-compose.yml down

Stacked on

Merge request reports

Loading