Skip to content

doc: docker minimal setup#2535

Open
Tubelight30 wants to merge 3 commits into
jackc:masterfrom
Tubelight30:doc-docker-minimal-setup
Open

doc: docker minimal setup#2535
Tubelight30 wants to merge 3 commits into
jackc:masterfrom
Tubelight30:doc-docker-minimal-setup

Conversation

@Tubelight30
Copy link
Copy Markdown
Contributor

I added a minimal PostgreSQL-in-Docker setup to CONTRIBUTING.md so someone can run go test ./... without installing PostgreSQL locally or using the devcontainer.
When I tried to set up the repo with a simple Docker Postgres container, I ran into two things that can be confusing for first-time contributors:

  • go test can show (cached) even if the external DB environment changed, so I documented using go test -count=1 ./... when validating DB-related tests.
  • Docker Postgres images often default to TimeZone=UTC while the Go process uses the host timezone (time.Local), which can cause timestamptz round-trip comparisons to fail. I documented running tests in UTC with TZ=UTC as a simple, deterministic workaround.

Document a minimal Docker-based PostgreSQL setup for running the test suite, including notes about go test caching and timezone-related timestamptz failures.
Document a minimal Docker-based PostgreSQL setup for running the test suite, including notes about go test caching and timezone-related timestamptz failures.
@Tubelight30 Tubelight30 changed the title Doc docker minimal setup doc: docker minimal setup Apr 15, 2026
@jackc
Copy link
Copy Markdown
Owner

jackc commented Apr 25, 2026

Docker Postgres images often default to TimeZone=UTC while the Go process uses the host timezone (time.Local), which can cause timestamptz round-trip comparisons to fail. I documented running tests in UTC with TZ=UTC as a simple, deterministic workaround.

That sounds like a test bug that should be fixed rather than documenting a workaround.

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.

3 participants