docs: integration-test bring-up flow + commit compose override#56
Merged
Conversation
After the harness in #55 landed, the actual flow to run integration tests against a live Postgres turned out to need three things the docs didn't mention: 1. docker-compose.override.yml that exposes 127.0.0.1:5432 to the host. The base docker-compose.yml deliberately keeps PG unreachable from the host for production hardening, but the vitest integration suite needs host-side TCP access. 2. \`docker compose down -v\` before re-running setup. The setup/TimeTracker.sql script does an unconditional \`CREATE SCHEMA dbo\` which fails (exit 3) against a populated postgres-data volume. Filed as a separate idempotency-fix tracker. 3. The exact env-var shape the integration suite reads (DB_HOST, DB_PORT, DB_NAME, DB_USERNAME, DB_PASSWORD). The override file is committed so contributors don't have to re-derive it. Production deployments should NOT use this override — port 5432 on a public host is a credential-brute-force invitation. The override's purpose and risk note are inline in the file's comment header. README gets a short "Testing" section pointing at tests/integration/README.md for the full flow. The integration README itself is rewritten end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
CryptoJones
added a commit
that referenced
this pull request
May 18, 2026
#57) setup/TimeTracker.sql is the pg_dump-produced bootstrap script. It wasn't authored with idempotency in mind: \`CREATE SCHEMA dbo\` (no IF NOT EXISTS), followed by ~40 statements that include \`CREATE TABLE\` without IF NOT EXISTS and \`ALTER TABLE ADD CONSTRAINT\` (which has no IF NOT EXISTS form at all). Result: \`docker compose up setup\` against a populated postgres volume exits 3 with "schema dbo already exists", which in turn prevents the chained \`migrate\` service from running, which left the docs in PR #56 with the \`docker compose down -v\` papercut. Rather than retrofit IF-NOT-EXISTS guards to every individual statement (and lose on ADD CONSTRAINT), gate the entire file at the top with a psql \\if check: SELECT EXISTS ( SELECT 1 FROM information_schema.schemata WHERE schema_name = 'dbo' ) AS dbo_exists \\gset \\if :dbo_exists \\echo 'dbo schema already exists — setup/TimeTracker.sql is a no-op' \\q \\endif If the schema is there, psql exits 0 with a friendly message; the chained migrate service then runs as designed. If the schema isn't there, the rest of the pg_dump body executes exactly as before. Verified locally against the running compose postgres: - DROP SCHEMA dbo CASCADE → fresh run exit 0, 14 tables created - immediate re-run → "no-op" message, exit 0 - subsequent migrate service still works (verified earlier this session) Co-authored-by: Aaron K. Clark <akclark@thenetwerk.net> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CryptoJones
added a commit
that referenced
this pull request
May 18, 2026
Continues the docs-sync pattern from #44 and #53. CHANGELOG [Unreleased] now reflects: Added: - Sequelize associations (#54) - Integration test harness (#55) - Postman collection (#59) - TLS reverse-proxy compose (#60) - docker-compose.override.yml committed (#56) Fixed: - setup/TimeTracker.sql idempotency (#57) — removes the \`docker compose down -v\` workaround Docs: - Integration bring-up flow (#56, #58) - README sections for Testing and Behind TLS Co-authored-by: Aaron K. Clark <akclark@thenetwerk.net> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Follow-up to #55, which shipped the harness but not the operational doc for actually running it. After driving the full bring-up against a live PG this session, three missing pieces became clear:
docker-compose.override.ymlcommitted: exposes 127.0.0.1:5432 for host-side test runs. The base compose deliberately keeps PG internal; the override is opt-in for the test path.down -vstep documented:setup/TimeTracker.sql's unconditionalCREATE SCHEMA dboblows up against a populated volume (exit 3). Workaround documented; a follow-up issue tracks the idempotency fix.README gets a short Testing section.
tests/integration/README.mdrewritten end-to-end.Test plan
docker compose config)npm test(without DB env vars) still passes; the integration suite skips cleanlyProudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/