fix(setup): write TEST_DATABASE_URL to .cascade/env for worker containers#828
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 14, 2026
Merged
Conversation
…ners Worker containers run setup.sh which already installs local PostgreSQL and creates cascade_test, but never wrote TEST_DATABASE_URL to .cascade/env. resolveTestDbUrl() already reads that file as its second fallback, so integration tests would fall through to the Docker Compose path (which fails with 'docker: not found' in containers). Also fixes sed -i portability: macOS requires 'sed -i ''' while Linux uses 'sed -i'. Replaces the file-existence guard with a 'touch' to ensure the file exists before the sed call. Co-Authored-By: Claude Sonnet 4.6 <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
setup.shnow writesTEST_DATABASE_URLto.cascade/envafter running migrations oncascade_test, soresolveTestDbUrl()picks up the local PostgreSQL instance in worker containers where Docker is unavailablesed -iportability: macOS requiressed -i ''while Linux usessed -i— now OS-branched consistently with the rest of the scriptif [ -f ]guard +mkdir -pwith a singletouchcall (simpler, correct)Root cause
Worker containers run
setup.shwhich installs local PostgreSQL and createscascade_test, but never wroteTEST_DATABASE_URLto.cascade/env.resolveTestDbUrl()already handles this file as its second fallback (after the process env var), but the value was never there, so it fell through to the Docker Compose path — which fails withdocker: not foundin containers.Test plan
npm run lint— cleannpm run typecheck— cleantests/unit/integration-helpers/db.test.tsfully covers the.cascade/envfallback path (no new tests needed for a shell-only change)🤖 Generated with Claude Code