From 61d58427934ceea9f898cc83485045c12123f8c4 Mon Sep 17 00:00:00 2001 From: Pranay Prakash Date: Mon, 17 Nov 2025 10:50:32 -0500 Subject: [PATCH 1/2] Add e2e tests for postgres world --- .github/workflows/tests.yml | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ff4f9d27c..a7f703aec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -243,6 +243,77 @@ jobs: APP_NAME: ${{ matrix.app.name }} DEPLOYMENT_URL: "http://localhost:${{ matrix.app.name == 'sveltekit' && '4173' || '3000' }}" + e2e-local-postgres: + name: E2E Local Postgres Tests (${{ matrix.app.name }} - ${{ matrix.app.canary && 'canary' || 'stable' }}) + runs-on: ubuntu-latest + needs: getTestMatrix + strategy: + fail-fast: false + matrix: ${{fromJson(needs.getTestMatrix.outputs.matrix)}} + + services: + postgres: + image: postgres:18-alpine + env: + POSTGRES_USER: world + POSTGRES_PASSWORD: world + POSTGRES_DB: world + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + WORKFLOW_TARGET_WORLD: "@workflow/world-postgres" + WORKFLOW_POSTGRES_URL: "postgres://world:world@localhost:5432/world" + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 10.14.0 + + - name: Setup Node.js 22.x + uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "pnpm" + + - name: Setup canary + if: ${{ matrix.app.canary }} + run: | + cat packages/next/package.json | jq '.dependencies.next|="canary"' > packages/next/package.json.new && mv packages/next/package.json.new packages/next/package.json + cat workbench/${{ matrix.app.name }}/package.json | jq '.dependencies.next|="canary"' > workbench/${{ matrix.app.name }}/package.json.new && mv workbench/${{ matrix.app.name }}/package.json.new workbench/${{ matrix.app.name }}/package.json + pnpm install --no-frozen-lockfile + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Run Initial Build + run: pnpm turbo run build --filter='!./workbench/*' + + - name: Setup PostgreSQL Database + run: cd packages/world-postgres && pnpm exec workflow-postgres-setup + + - name: Run Build Tests + run: pnpm vitest run packages/core/e2e/local-build.test.ts + env: + APP_NAME: ${{ matrix.app.name }} + + - name: Run E2E Tests + run: cd workbench/${{ matrix.app.name }} && pnpm start & echo "starting tests in 10 seconds" && sleep 10 && pnpm run test:e2e + env: + APP_NAME: ${{ matrix.app.name }} + DEPLOYMENT_URL: "http://localhost:${{ matrix.app.name == 'sveltekit' && '4173' || '3000' }}" + e2e-windows: name: E2E Windows Tests runs-on: windows-latest From 6fa4cf8d91b5c249dc266dcadc14d8851e982496 Mon Sep 17 00:00:00 2001 From: Pranay Prakash Date: Mon, 17 Nov 2025 14:45:54 -0500 Subject: [PATCH 2/2] Add e2e tests for postgres world - Add new e2e-local-postgres job to test all workbenches against postgres world - Configure PostgreSQL service container in GitHub Actions - Update world-postgres build script to chmod +x the setup.js bin - Use direct path to setup script in CI for reliability - Tests run in production mode similar to e2e-local-prod tests --- .github/workflows/tests.yml | 2 +- packages/world-postgres/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a7f703aec..0d4438520 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -301,7 +301,7 @@ jobs: run: pnpm turbo run build --filter='!./workbench/*' - name: Setup PostgreSQL Database - run: cd packages/world-postgres && pnpm exec workflow-postgres-setup + run: ./packages/world-postgres/bin/setup.js - name: Run Build Tests run: pnpm vitest run packages/core/e2e/local-build.test.ts diff --git a/packages/world-postgres/package.json b/packages/world-postgres/package.json index 4cdb7eba2..b3d603e44 100644 --- a/packages/world-postgres/package.json +++ b/packages/world-postgres/package.json @@ -37,7 +37,7 @@ "./migrations/*.sql": "./src/drizzle/migrations/*.sql" }, "scripts": { - "build": "tsc", + "build": "tsc && chmod +x bin/setup.js", "dev": "tsc --watch", "clean": "tsc --build --clean && rm -rf dist", "test": "vitest run",