From f8a3649dfbef74e026427511de244b9f17bff686 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:25:45 -0700 Subject: [PATCH] fix: preserve DATABASE_URL from environment in e2e scripts --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d1b31df..63a5b5a 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ "test:unit:sequential": "bun test src/__tests__/unit/ --max-concurrency=1", "test:acceptance": "bun x playwright test e2e/", "test:acceptance:headed": "bun x playwright test e2e/ --headed", - "test:acceptance:cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts", - "test:acceptance:cucumber:pretty": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts --format pretty:cucumber-pretty", - "test:acceptance:cucumber:prod": "bun run build && (trap 'kill $(jobs -p) 2>/dev/null || true' EXIT; DATABASE_URL=${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')} DATABASE_PROVIDER=${DATABASE_PROVIDER:-postgresql} bun run start & echo 'Waiting for server to start...'; for i in {1..30}; do if curl -s http://localhost:3000 > /dev/null 2>&1; then echo 'Server ready!'; break; fi; sleep 1; done; bun run test:acceptance:cucumber)", - "cucumber": "DATABASE_URL=$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"') DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts", + "test:acceptance:cucumber": "DATABASE_URL=\"${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')}\" DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts", + "test:acceptance:cucumber:pretty": "DATABASE_URL=\"${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')}\" DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts --format pretty:cucumber-pretty", + "test:acceptance:cucumber:prod": "bun run build && (trap 'kill $(jobs -p) 2>/dev/null || true' EXIT; export DATABASE_URL=\"${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')}\" DATABASE_PROVIDER=\"${DATABASE_PROVIDER:-postgresql}\" bun run start & echo 'Waiting for server to start...'; for i in {1..30}; do if curl -s http://localhost:3000 > /dev/null 2>&1; then echo 'Server ready!'; break; fi; sleep 1; done; bun run test:acceptance:cucumber)", + "cucumber": "DATABASE_URL=\"${DATABASE_URL:-$(grep DATABASE_URL .env.development | cut -d'=' -f2 | tr -d '\"')}\" DATABASE_PROVIDER=postgresql bun cucumber-js --config e2e/cucumber/cucumber.config.ts", "db:setup-dev": "bun run scripts/setup-postgres.js", "db:setup-dev:clean": "bun run scripts/setup-postgres.js --drop", "db:cleanup-prod": "bun run scripts/cleanup-prod-db.js",