From b5b9f32a877c22be63447201503244e23e4d3bcf Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:15:15 -0700 Subject: [PATCH 1/5] chore: consolidate npm to bun in CI workflows - Update justfile to use bun instead of npm for all commands - Fix broken test glob patterns in package.json and workflows - Fix npm run test:acceptance:cucumber:prod to use bun - Update pr.yml and release.yml unit test commands to use correct path format - Run 157 unit tests (was only running ~2 due to broken glob) --- .gitea/workflows/pr.yml | 4 ++-- .gitea/workflows/release.yml | 2 +- justfile | 44 ++++++++++++++++++------------------ package.json | 6 ++--- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 6de9407..4f661fc 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -28,7 +28,7 @@ jobs: DATABASE_URL: postgresql://user:pass@localhost:5432/dummy - name: Run unit tests - run: bun test src/__tests__/unit/ src/__tests__/*.test.tsx src/__tests__/auth-simple.test.ts + run: bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts e2e-tests: runs-on: ubuntu-latest @@ -53,7 +53,7 @@ jobs: DATABASE_URL: postgresql://user:pass@localhost:5432/dummy - name: Run E2E tests - run: npm run test:acceptance:cucumber:prod + run: bun run test:acceptance:cucumber:prod env: DATABASE_URL: postgresql://euchre_camp:${{ secrets.DB_PASSWORD }}@dhg.lol:5432/euchre_camp_dev DATABASE_PROVIDER: postgresql diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 9394d39..7f24f42 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -122,7 +122,7 @@ jobs: docker run --rm \ -e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \ ${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.new_version }} \ - bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts' + bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts - name: Build production image if: steps.commit.outputs.committed == 'true' diff --git a/justfile b/justfile index e4cb07f..98b57f9 100644 --- a/justfile +++ b/justfile @@ -29,21 +29,21 @@ DATABASE_URL := env_var_or_default("DATABASE_URL", "") # Install dependencies and setup environment setup: @echo "Installing dependencies..." - npm install + bun install @echo "Setting up database..." - npm run db:setup-dev + bun run db:setup-dev @echo "Generating Prisma client..." - npx prisma generate + bun x prisma generate # --- Development --- # Start the development server dev: - npm run dev + bun run dev # Lint the codebase lint: - npm run lint + bun run lint # Type check the codebase typecheck: @@ -60,19 +60,19 @@ test: test-unit test-acceptance # Run unit tests test-unit: - npm run test:run + DATABASE_URL="postgresql://test:test@localhost:5432/test" bun test src/__tests__/unit/ # Run acceptance tests (Playwright) test-acceptance: @echo "Running acceptance tests..." - npm run test:acceptance + bun x playwright test e2e/ # Run Cucumber e2e tests test-cucumber: @echo "Clearing Next.js cache..." rm -rf .next/ @echo "Running Cucumber e2e tests..." - npm run test:acceptance:cucumber + bun run test:acceptance:cucumber # Run Cucumber e2e tests against production build test-cucumber-prod: @@ -86,18 +86,18 @@ test-cucumber-prod: @echo "Waiting for server to be ready..." sleep 15 @echo "Running Cucumber e2e tests against production build..." - npm run test:acceptance:cucumber || true + bun run test:acceptance:cucumber || true @echo "Stopping production server..." kill $$SERVER_PID 2>/dev/null || true @echo "Tests completed." # Run database migrations (Prisma) migrate: - npx prisma migrate dev + bun x prisma migrate dev # Seed the database seed: - npm run db:seed + bun run scripts/seed.js # --- Docker --- @@ -181,23 +181,23 @@ clean: # Generate Prisma client prisma-generate: - npx prisma generate + bun x prisma generate # Reset development database db-reset-dev: - npm run db:reset-dev + bun run scripts/setup-postgres.js --drop # Setup development database db-setup-dev: - npm run db:setup-dev + bun run scripts/setup-postgres.js # Clean production database (remove test records) db-clean-prod: - npm run db:cleanup-prod + bun run scripts/cleanup-prod-db.js # Check production database for test records db-check-prod: - npm run db:check-prod + bun run scripts/check-test-records.js # Create admin user admin-create: @@ -213,23 +213,23 @@ admin-update-password: # Bump version version-bump-patch: - npm run version:patch + bun run scripts/bump-version.js patch version-bump-minor: - npm run version:minor + bun run scripts/bump-version.js minor version-bump-major: - npm run version:major + bun run scripts/bump-version.js major # Docker Compose shortcuts docker-up: - npm run docker:up + docker-compose up -d docker-down: - npm run docker:down + docker-compose down docker-logs: - npm run docker:logs + docker-compose logs -f # View workflow status workflow-status: diff --git a/package.json b/package.json index 6cef337..d1b31df 100644 --- a/package.json +++ b/package.json @@ -7,17 +7,17 @@ "build": "next build", "start": "next start", "lint": "bun run eslint", - "test": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'", + "test": "bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts", "test:unit": "bun test src/__tests__/unit/", "test:component": "bun test src/__tests__/*.test.tsx", - "test:run": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'", + "test:run": "bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts", "test:randomize": "bun test src/__tests__/unit/ --randomize", "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; npm run test:acceptance:cucumber)", + "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", "db:setup-dev": "bun run scripts/setup-postgres.js", "db:setup-dev:clean": "bun run scripts/setup-postgres.js --drop", -- 2.52.0 From 51b6763e876d42ed9a682f54fea4bea29c70fb38 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:16:28 -0700 Subject: [PATCH 2/5] ci: trigger workflow -- 2.52.0 From f6f06aef33566f126c10df3d5a5121a2ff447f3b Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:18:30 -0700 Subject: [PATCH 3/5] fix: add DATABASE_URL env to unit tests in CI --- .gitea/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 4f661fc..b49d2d4 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -29,6 +29,8 @@ jobs: - name: Run unit tests run: bun test src/__tests__/unit/ 'src/__tests__/*.test.tsx' src/__tests__/auth-simple.test.ts + env: + DATABASE_URL: postgresql://user:pass@localhost:5432/dummy e2e-tests: runs-on: ubuntu-latest -- 2.52.0 From f8a3649dfbef74e026427511de244b9f17bff686 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:25:45 -0700 Subject: [PATCH 4/5] 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", -- 2.52.0 From ae3403c50047216ecad40815d6d83f610202c884 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 10 May 2026 21:28:03 -0700 Subject: [PATCH 5/5] ci: retry after lightningcss extraction issue -- 2.52.0