feat: isolated test database & DX improvements#10
Merged
earhackerdem merged 8 commits intomasterfrom Mar 22, 2026
Merged
Conversation
- Add .env.example as template with changethis placeholders for secrets - Add scripts/setup.sh to generate .env with random secrets from .env.example - Add Makefile with commands: setup, dev, up, down, logs, test, test-backend, generate-client - Update README with Quick Start section, commands table and E2E test workflow Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Add .env and .DS_Store to .gitignore (security fix) - Create compose.test.yml with ephemeral db-test (tmpfs), prestart-test, backend-test (no host port mapping), and playwright override - Split make down (preserves volumes) from make clean (destructive) - Rewrite make test / test-backend to use isolated test DB with cleanup-on-failure pattern - Harden setup.sh with set -euo pipefail - Update README with new commands and simplified test docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove `build:` from prestart and prestart-test since they share the same image tag as backend/backend-test. BuildKit was racing to export both to the same tag in parallel, causing "image already exists" errors. Now only backend builds the image; prestart reuses it. Makefile targets pre-build the image before starting services. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The .env file was added to .gitignore but never untracked from the index, so generated secrets (SECRET_KEY, POSTGRES_PASSWORD, etc.) were still being committed. This removes it from tracking while keeping the local file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract shared environment variables into x-test-env YAML anchor in compose.test.yml, eliminating ~30 lines of duplication between prestart-test and backend-test services - Remove unnecessary --reload flag from backend-test (tests don't need hot-reload) - Add .env.example existence check in setup.sh before copying Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Drop compose.override.yml from COMPOSE_TEST to prevent Docker Compose from merging playwright's depends_on with the dev backend service, which cascaded into starting db, prestart, and backend alongside tests - Add mailcatcher and full playwright definition to compose.test.yml so tests are fully self-contained - Fix race condition in EditUser.tsx where the dialog closed before the query cache was refreshed, causing the table to show stale data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverts the EditUser.tsx race-condition fix (unrelated to this PR's scope). Replaces `$(COMPOSE_TEST) down` with targeted `rm -sf` of test containers so that `make test` no longer kills dev services started by `make dev`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use **/.DS_Store glob to catch nested occurrences - Add playwright to test cleanup in Makefile - Consolidate three sed calls into one in setup.sh - Add Docker prerequisite note to README Quick Start Co-Authored-By: Claude Opus 4.6 (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.
Summary
compose.test.ymlwith an ephemeraldb-testservice (tmpfs — no volumes, no cleanup needed). Tests never touch dev data, andmake testcan run alongsidemake devwith no port conflicts.make down: Now preserves volumes; addedmake cleanfor explicit destructive teardown..envand.DS_Storeto.gitignore—setup.shgenerates real secrets into.env.setup.sh:set -euo pipefailfor fail-fast behavior.Changes
.gitignore.env,.DS_Storecompose.test.ymldb-test(tmpfs),prestart-test,backend-test,playwrightoverrideMakefiledown/clean, rewritetest/test-backendwith cleanup-on-failurescripts/setup.shset -e→set -euo pipefailREADME.mdTest plan
make setup— generates.envwith secretsmake dev— start full dev stack, create some datamake test— E2E tests run against isolateddb-test; dev data untouchedmake test-backend— backend tests against isolateddb-testmake testwhilemake devis running — no port conflictsmake down— stops containers, data preserved in volumemake clean— stops containers AND removes volumes🤖 Generated with Claude Code