Repository navigation
test(infra): local postgres test-db for trypost-fork on port 5433 - #6
Merged
Merged
Conversation
Port 5432 is occupied by another project's Docker container on this machine, so .env.testing's DB_HOST=127.0.0.1 pointed at the wrong database and the entire test suite failed with a bad auth error. Adds compose.test.yml, a minimal, isolated Postgres 16 container (binds 127.0.0.1:5433 only) dedicated to the test suite, independent from the full compose.yaml dev stack. Reuses docker/postgres-init.sh to create the trypost_test database, matching the existing convention. Updates .env.testing to point at the new port and credentials (DB_PASSWORD already matched phpunit.xml's committed value, DB_USERNAME now matches the container's postgres user). Documents the setup, the passport:keys requirement (storage/oauth-*.key are gitignored and not generated by default, causing every OAuth-backed test to fail with "Invalid key supplied" until generated), the memory limit needed for image-processing tests, and why php artisan test cannot be used locally (it boots the full console kernel against the default .env before phpunit's env vars apply) in a new CLAUDE.md section. Full suite verified green: 4553 passed, 2 skipped, 0 failed. Koeder test: inverted an assertion in the newly landed Facebook story publisher test (a30d83c), confirmed it failed red, reverted, confirmed green again.
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.
Summary
Plan
~/.claude/plans/proud-bubbling-dewdrop.md, Paket T0.This machine has no working local test database for trypost-fork. Port 5432
is occupied by another project's Docker container (
blogmaker-test-db),so
.env.testing(DB_HOST=127.0.0.1, formerly DB_PORT=5432) was pointing atthe wrong Postgres server, and the entire Facebook publisher test suite
failed 25/0.
compose.test.yml: a minimal, isolated Postgres 16 container boundto
127.0.0.1:5433only, separate from the fullcompose.yamldev stack(which already forwards 5432 by default and is meant to run alongside the
Dockerized
appservice). Reusesdocker/postgres-init.shto create thetrypost_testdatabase, matching the existing convention..env.testing:DB_PORT=5433,DB_USERNAME=postgres,DB_PASSWORD=password(matches the value already committed inphpunit.xml, no new secret).## Local Test Databasesection toCLAUDE.mddocumenting thecontainer start/stop/reset commands, the
passport:keysrequirement(
storage/oauth-*.keyare gitignored and not generated by default,causing every OAuth-backed test to fail with
Invalid key supplieduntilgenerated), the memory-limit bump needed for the image-processing tests,
and why
php artisan testcannot be used locally without a.envfile(it boots the console kernel against the default env before PHPUnit's
<php><env>block applies, unlikevendor/bin/pestinvoked directly).Test plan
APP_ENV=testing php -d memory_limit=1024M vendor/bin/pest --compact-> 4553 passed, 2 skipped, 0 failed (16396 assertions), run twice for consistency.facebook publisher can publish video story,facebook publisher fails story publish when start does not return upload_url) are included and pass (39/39 in that file).facebook publisher can publish video story, confirmed it failed red (Failed asserting that two strings are identical), reverted, confirmed green again (39 passed).code-reviewerPASS (security, secrets, bind address, doc placement, dash-convention, consistency withcompose.yamlall checked; one cosmetic note on a differing healthcheck interval, no blocker) plus independent self-review, both agree.check-dashes.sh --staged: clean.git check-ignore -v .env.testing: confirmed tracked (only/docs/is gitignored, not this file).Follow-up chips A0-A5 and B0-B4 all depend on this green test database and
can start once this is merged.