From 6845930cb5c6562047fa707753c854ea0d1bd1d6 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:19:20 +0100 Subject: [PATCH 01/14] run more tests, more of the time --- .github/dependabot.yml | 5 +- .github/pull_request_template.md | 4 - .github/workflows/c3-e2e.yml | 76 +++--------------- .github/workflows/e2e.yml | 72 +++-------------- .github/workflows/test-and-check.yml | 111 +++++---------------------- 5 files changed, 43 insertions(+), 225 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 83a5fb477ad6..8e018c9b6a9b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -41,5 +41,6 @@ updates: labels: - "dependencies" - "skip-pr-description-validation" - - "e2e" - - "every-os" + allow: + - dependency-name: "workerd" + - dependency-name: "@cloudflare/workers-types" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5a088feb4972..958f6a6eb704 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,10 +13,6 @@ The following selections do not need to be completed if this PR only contains ch - [ ] TODO (before merge) - [ ] Tests included - [ ] Tests not necessary because: -- Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [ ] Not required because: - Public documentation - [ ] TODO (before merge) - [ ] Cloudflare docs PR(s): diff --git a/.github/workflows/c3-e2e.yml b/.github/workflows/c3-e2e.yml index bdb703b947a4..3de5104a6f5b 100644 --- a/.github/workflows/c3-e2e.yml +++ b/.github/workflows/c3-e2e.yml @@ -1,5 +1,6 @@ name: C3 E2E Tests on: + merge_group: pull_request: types: [synchronize, opened, reopened, labeled, unlabeled] @@ -8,10 +9,9 @@ env: NODE_VERSION: 22 jobs: - e2e-vp: + e2e: # Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one #  in .github/workflows/c3-e2e-dependabot.yml - if: github.head_ref == 'changeset-release/main' || (contains(github.event.*.labels.*.name, 'c3-e2e' ) && contains(github.event.*.labels.*.name, 'every-os' )) timeout-minutes: 45 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} @@ -21,7 +21,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - pm: [{ name: npm, version: "0.0.0" }, { name: yarn, version: "1.0.0" }] + pm: + [ + { name: npm, version: "0.0.0" }, + { name: yarn, version: "1.0.0" }, + { name: pnpm, version: "9.12.0" }, + ] # include a single windows test with pnpm include: - os: windows-latest @@ -49,67 +54,10 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: E2E Tests (experimental) - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/run-c3-e2e - with: - node-version: ${{ env.NODE_VERSION }} - packageManager: ${{ matrix.pm.name }} - packageManagerVersion: ${{ matrix.pm.version }} - quarantine: false - experimental: true - accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - - - name: E2E Tests (non-experimental) - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/run-c3-e2e - with: - node-version: ${{ env.NODE_VERSION }} - packageManager: ${{ matrix.pm.name }} - packageManagerVersion: ${{ matrix.pm.version }} - quarantine: false - experimental: false - accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - - e2e: - # Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one - #  in .github/workflows/c3-e2e-dependabot.yml - if: contains(github.event.*.labels.*.name, 'c3-e2e' ) - timeout-minutes: 45 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} - cancel-in-progress: true - name: ${{ format('Run tests for {0}@{1} on {2}', matrix.pm.name, matrix.pm.version, matrix.os) }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - pm: [{ name: pnpm, version: "9.12.0" }] - - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - everything_but_markdown: - - '!**/*.md' - - name: Install Dependencies - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/install-dependencies - with: - node-version: ${{ env.NODE_VERSION }} - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + - name: Bump package versions + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} - name: E2E Tests (experimental) if: steps.changes.outputs.everything_but_markdown == 'true' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0fa91a923114..9bfa59fe42a0 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,31 +1,32 @@ name: E2E tests on: + merge_group: pull_request: types: [synchronize, opened, reopened, labeled, unlabeled] - repository_dispatch: jobs: - e2e-test-vp: + e2e-test: name: "E2E tests" concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} cancel-in-progress: true timeout-minutes: 60 - if: github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' ) && github.event.pull_request.head.repo.owner.login == 'cloudflare' && (github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' )) strategy: fail-fast: false matrix: - os: [macos-13, windows-2022] + os: [macos-13, windows-2022, ubuntu-22.04-arm] node: ["20.19.1"] runs-on: ${{ matrix.os }} steps: - name: Checkout Repo + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Dependencies + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: ./.github/actions/install-dependencies with: node-version: ${{ matrix.node }} @@ -34,67 +35,13 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: Run Vite E2E tests - run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream - timeout-minutes: 15 + - name: Bump package versions + run: node .github/changeset-version.js env: - NODE_DEBUG: "vite-plugin:test" - # The AI tests need to connect to Cloudflare - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - CI_OS: ${{ matrix.os }} - - - name: Run Wrangler E2E tests - run: pnpm run test:e2e:wrangler - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - HYPERDRIVE_DATABASE_URL: ${{ secrets.TEST_HYPERDRIVE_DATABASE_URL}} - WRANGLER: node --no-warnings ${{ github.workspace}}/packages/wrangler/bin/wrangler.js - WRANGLER_IMPORT: ${{ github.workspace}}/packages/wrangler/wrangler-dist/cli.js - MINIFLARE_IMPORT: ${{ github.workspace}}/packages/miniflare/dist/src/index.js - NODE_OPTIONS: "--max_old_space_size=8192" - WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ - TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os }} - - - name: Upload turbo logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} - path: .turbo/runs - - e2e-test: - name: "E2E tests" - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} - cancel-in-progress: true - timeout-minutes: 60 - if: github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' ) && github.event.pull_request.head.repo.owner.login == 'cloudflare' - strategy: - fail-fast: false - matrix: - os: [ubuntu-22.04-arm] - node: ["20.19.1"] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - with: - node-version: ${{ matrix.node }} - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + GITHUB_TOKEN: ${{ github.token }} - name: Run Vite E2E tests + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream timeout-minutes: 15 env: @@ -106,6 +53,7 @@ jobs: CI_OS: ${{ matrix.os }} - name: Run Wrangler E2E tests + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' run: pnpm run test:e2e:wrangler env: CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 0ff59e0b2a4f..887dca0d7a3f 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -17,8 +17,7 @@ jobs: steps: - run: curl -X POST https://devprod-status-bot.devprod.workers.dev/pr-project/workers-sdk/${{ github.event.number }} - check-vp: - if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' ) + check: timeout-minutes: 30 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-checks @@ -28,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04-arm, windows-latest] + os: [ubuntu-24.04-arm, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout Repo @@ -44,42 +43,16 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: Check for errors - run: pnpm run check --summarize + - name: Bump package versions + run: node .github/changeset-version.js env: - CI_OS: ${{ runner.os }} - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Check the changesets - run: node -r esbuild-register tools/deployments/validate-changesets.ts - - check: - timeout-minutes: 30 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-pr-checks - cancel-in-progress: true - - name: "Checks" - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - with: - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + GITHUB_TOKEN: ${{ github.token }} - name: Check for errors run: pnpm run check --summarize env: - NODE_OPTIONS: "--max_old_space_size=8192" CI_OS: ${{ runner.os }} + NODE_OPTIONS: "--max_old_space_size=8192" - name: Check the changesets run: node -r esbuild-register tools/deployments/validate-changesets.ts @@ -108,8 +81,7 @@ jobs: - name: Check for error message on Node.js < v20 run: node packages/wrangler/src/__tests__/test-old-node-version.js error - test-vp: - if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' ) + test: timeout-minutes: 30 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test @@ -120,9 +92,14 @@ jobs: fail-fast: false matrix: include: + - os: macos-latest + os_name: macOS + node_version: 20.19.1 + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - os: ubuntu-24.04-arm os_name: Linux node_version: 20.19.1 + # ./tools _only_ runs here because they're only intended to run in CI filter: '--filter="./tools" --filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: windows-latest os_name: Windows @@ -131,64 +108,12 @@ jobs: - os: ubuntu-24.04-arm os_name: v22, Linux node_version: 22 - filter: '--filter="./packages/*" --filter="!./packages/kv-asset-handler"' - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - everything_but_markdown: - - '!**/*.md' - - - name: Install Dependencies - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/install-dependencies - with: - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - node-version: ${{ matrix.node_version }} - - - name: Run tests - if: steps.changes.outputs.everything_but_markdown == 'true' - run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} --log-order=stream - env: - TEST_CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - TEST_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ - TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os_name }} - - - name: Upload turbo logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} - path: .turbo/runs - - test: - timeout-minutes: 30 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test - cancel-in-progress: true + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground --filter="!./packages/kv-asset-handler"' + - os: ubuntu-24.04-arm + os_name: v24, Linux + node_version: 24 + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground --filter="!./packages/kv-asset-handler"' - name: ${{ format('Tests ({0})', matrix.os_name) }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - os_name: macOS - node_version: 20.19.1 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' runs-on: ${{ matrix.os }} steps: - name: Checkout Repo @@ -215,7 +140,7 @@ jobs: - name: Run tests if: steps.changes.outputs.everything_but_markdown == 'true' - run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} + run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} --log-order=stream env: TEST_CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} TEST_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} From 08189c057f91fc3b263aaf8255b877793e8d867d Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:21:08 +0100 Subject: [PATCH 02/14] Checks can be single-os --- .github/workflows/test-and-check.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 887dca0d7a3f..b41a8376f4be 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -24,11 +24,7 @@ jobs: cancel-in-progress: true name: "Checks" - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04-arm, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-24.04-arm steps: - name: Checkout Repo uses: actions/checkout@v4 From 96b28c148e39cb9544371b95f62932d2ba202da3 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:23:15 +0100 Subject: [PATCH 03/14] syntax --- .github/workflows/test-and-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index b41a8376f4be..a6b6344bdd05 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -104,11 +104,11 @@ jobs: - os: ubuntu-24.04-arm os_name: v22, Linux node_version: 22 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground --filter="!./packages/kv-asset-handler"' + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' - os: ubuntu-24.04-arm os_name: v24, Linux node_version: 24 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground --filter="!./packages/kv-asset-handler"' + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' runs-on: ${{ matrix.os }} steps: From 70a8c94e2fe25dbd43a5f93d2b16945f696e923c Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:24:45 +0100 Subject: [PATCH 04/14] syntax --- .github/workflows/test-and-check.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index a6b6344bdd05..dea8f5e91836 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -134,6 +134,11 @@ jobs: turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} node-version: ${{ matrix.node_version }} + - name: Bump package versions + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Run tests if: steps.changes.outputs.everything_but_markdown == 'true' run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} --log-order=stream From 7d07dd21f7e8b6155602dd24f9af9d1312f51a5f Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:40:56 +0100 Subject: [PATCH 05/14] add more labels --- .github/workflows/c3-e2e.yml | 22 ++++--- .github/workflows/e2e.yml | 91 ++++++++++++++++++++++------ .github/workflows/test-and-check.yml | 14 ++--- 3 files changed, 93 insertions(+), 34 deletions(-) diff --git a/.github/workflows/c3-e2e.yml b/.github/workflows/c3-e2e.yml index 3de5104a6f5b..4988a639ea7d 100644 --- a/.github/workflows/c3-e2e.yml +++ b/.github/workflows/c3-e2e.yml @@ -1,4 +1,4 @@ -name: C3 E2E Tests +name: E2E on: merge_group: pull_request: @@ -16,20 +16,22 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} cancel-in-progress: true - name: ${{ format('Run tests for {0}@{1} on {2}', matrix.pm.name, matrix.pm.version, matrix.os) }} + name: ${{ format('C3 ({0})', matrix.label) }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] - pm: - [ - { name: npm, version: "0.0.0" }, - { name: yarn, version: "1.0.0" }, - { name: pnpm, version: "9.12.0" }, - ] - # include a single windows test with pnpm include: - os: windows-latest + label: pnpm, Windows + pm: { name: pnpm, version: "9.12.0" } + - os: ubuntu-latest + label: npm, Linux + pm: { name: npm, version: "0.0.0" } + - os: ubuntu-latest + label: yarn, Linux + pm: { name: yarn, version: "1.0.0" } + - os: ubuntu-latest + label: pnpm, Linux pm: { name: pnpm, version: "9.12.0" } runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9bfa59fe42a0..92ad306ba842 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,4 @@ -name: E2E tests +name: E2E on: merge_group: @@ -6,8 +6,8 @@ on: types: [synchronize, opened, reopened, labeled, unlabeled] jobs: - e2e-test: - name: "E2E tests" + e2e-wrangler-test: + name: ${{ format('Wrangler ({0})', matrix.label) }} concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} cancel-in-progress: true @@ -15,8 +15,17 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, windows-2022, ubuntu-22.04-arm] - node: ["20.19.1"] + include: + - os: macos-13 + label: v20, macOS + node: 20.19.1 + - os: windows-2022 + label: v20, Windows + node: 20.19.1 + - os: ubuntu-22.04-arm + label: v20, Linux + node: 20.19.1 + runs-on: ${{ matrix.os }} steps: - name: Checkout Repo @@ -40,18 +49,6 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} - - name: Run Vite E2E tests - if: github.event.pull_request.head.repo.owner.login == 'cloudflare' - run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream - timeout-minutes: 15 - env: - NODE_DEBUG: "vite-plugin:test" - # The AI tests need to connect to Cloudflare - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - CI_OS: ${{ matrix.os }} - - name: Run Wrangler E2E tests if: github.event.pull_request.head.repo.owner.login == 'cloudflare' run: pnpm run test:e2e:wrangler @@ -73,3 +70,63 @@ jobs: with: name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} path: .turbo/runs + + e2e-vite-test: + name: ${{ format('Vite ({0})', matrix.label) }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} + cancel-in-progress: true + timeout-minutes: 60 + strategy: + matrix: + include: + - os: macos-13 + label: v20, macOS + node: 20.19.1 + - os: windows-2022 + label: v20, Windows + node: 20.19.1 + - os: ubuntu-22.04-arm + label: v20, Linux + node: 20.19.1 + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repo + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Dependencies + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' + uses: ./.github/actions/install-dependencies + with: + node-version: ${{ matrix.node }} + turbo-api: ${{ secrets.TURBO_API }} + turbo-team: ${{ secrets.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + + - name: Bump package versions + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Run Vite E2E tests + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' + run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream + timeout-minutes: 15 + env: + NODE_DEBUG: "vite-plugin:test" + # The AI tests need to connect to Cloudflare + CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + NODE_OPTIONS: "--max_old_space_size=8192" + CI_OS: ${{ matrix.os }} + + - name: Upload turbo logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} + path: .turbo/runs diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index dea8f5e91836..c0fc89ff7862 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -83,30 +83,30 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test cancel-in-progress: true - name: ${{ format('Tests ({0})', matrix.os_name) }} + name: ${{ format('Tests ({0})', matrix.label) }} strategy: fail-fast: false matrix: include: - os: macos-latest - os_name: macOS + label: v20, macOS node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - os: ubuntu-24.04-arm - os_name: Linux + label: v20, Linux node_version: 20.19.1 # ./tools _only_ runs here because they're only intended to run in CI filter: '--filter="./tools" --filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: windows-latest - os_name: Windows + label: v20, Windows node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: ubuntu-24.04-arm - os_name: v22, Linux + label: v22, Linux node_version: 22 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' - os: ubuntu-24.04-arm - os_name: v24, Linux + label: v24, Linux node_version: 24 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' @@ -148,7 +148,7 @@ jobs: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os_name }} + CI_OS: ${{ matrix.label }} - name: Upload turbo logs if: always() From 082238e65289aaf26d0f134ee125a1e2accece16 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:42:01 +0100 Subject: [PATCH 06/14] fix group --- .github/workflows/e2e.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 92ad306ba842..94a7126760e3 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,7 +9,7 @@ jobs: e2e-wrangler-test: name: ${{ format('Wrangler ({0})', matrix.label) }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-wrangler cancel-in-progress: true timeout-minutes: 60 strategy: @@ -74,7 +74,7 @@ jobs: e2e-vite-test: name: ${{ format('Vite ({0})', matrix.label) }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-vite cancel-in-progress: true timeout-minutes: 60 strategy: From 193503fb3da867ef58aa41457aa171aa76ec9e33 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:44:49 +0100 Subject: [PATCH 07/14] fix group --- fixtures/interactive-dev-tests/package.json | 2 +- pnpm-lock.yaml | 53 ++++++++++++++++----- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/fixtures/interactive-dev-tests/package.json b/fixtures/interactive-dev-tests/package.json index e59457630e62..d48fa99c9f10 100644 --- a/fixtures/interactive-dev-tests/package.json +++ b/fixtures/interactive-dev-tests/package.json @@ -12,7 +12,7 @@ "vitest": "catalog:default" }, "optionalDependencies": { - "@cdktf/node-pty-prebuilt-multiarch": "0.10.1-pre.11" + "@cdktf/node-pty-prebuilt-multiarch": "0.10.2" }, "volta": { "extends": "../../package.json" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87d83266b633..94e853ecea34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -370,8 +370,8 @@ importers: fixtures/interactive-dev-tests: optionalDependencies: '@cdktf/node-pty-prebuilt-multiarch': - specifier: 0.10.1-pre.11 - version: 0.10.1-pre.11 + specifier: 0.10.2 + version: 0.10.2 devDependencies: '@fixture/shared': specifier: workspace:* @@ -3950,8 +3950,8 @@ packages: '@bundled-es-modules/tough-cookie@0.1.6': resolution: {integrity: sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==} - '@cdktf/node-pty-prebuilt-multiarch@0.10.1-pre.11': - resolution: {integrity: sha512-qvga/nzEtdCJMu/6jJfDqpzbRejvXtNhWFnbubfuYyN5nMNORNXX+POT4j+mQSDQar5bIQ1a812szw/zr47cfw==} + '@cdktf/node-pty-prebuilt-multiarch@0.10.2': + resolution: {integrity: sha512-Bpb0v9bzejJUAGmn8HfDFH6pYxFVHokiWV4mHvTao2XoYcEvETFVrniYIXlIg0e4yLlKB/U/z5WsC5PBsi3xEQ==} '@changesets/apply-release-plan@7.0.9': resolution: {integrity: sha512-xB1shQP6WhflnAN+rV8eJ7j4oBgka/K62+pHuEv6jmUtSqlx2ZvJSnCGzyNfkiQmSfVsqXoI3pbAuyVpTbsKzA==} @@ -10428,6 +10428,9 @@ packages: napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + napi-build-utils@2.0.0: + resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -11197,6 +11200,11 @@ packages: engines: {node: '>=10'} hasBin: true + prebuild-install@7.1.3: + resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} + engines: {node: '>=10'} + hasBin: true + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -13831,10 +13839,10 @@ snapshots: '@types/tough-cookie': 4.0.5 tough-cookie: 4.1.4 - '@cdktf/node-pty-prebuilt-multiarch@0.10.1-pre.11': + '@cdktf/node-pty-prebuilt-multiarch@0.10.2': dependencies: nan: 2.18.0 - prebuild-install: 7.1.2 + prebuild-install: 7.1.3 optional: true '@changesets/apply-release-plan@7.0.9': @@ -13851,7 +13859,7 @@ snapshots: outdent: 0.5.0 prettier: 2.7.1 resolve-from: 5.0.0 - semver: 7.7.1 + semver: 7.7.2 '@changesets/assemble-release-plan@6.0.6': dependencies: @@ -13860,7 +13868,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - semver: 7.7.1 + semver: 7.7.2 '@changesets/changelog-git@0.2.1': dependencies: @@ -13924,7 +13932,7 @@ snapshots: '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 picocolors: 1.1.1 - semver: 7.7.1 + semver: 7.7.2 '@changesets/get-github-info@0.6.0(encoding@0.1.13)': dependencies: @@ -15211,7 +15219,7 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.7.1 + semver: 7.7.2 tar: 6.2.1 transitivePeerDependencies: - encoding @@ -20882,6 +20890,9 @@ snapshots: napi-build-utils@1.0.2: {} + napi-build-utils@2.0.0: + optional: true + natural-compare@1.4.0: {} negotiator@0.6.3: {} @@ -21120,7 +21131,7 @@ snapshots: ky: 1.7.5 registry-auth-token: 5.0.2 registry-url: 6.0.1 - semver: 7.7.1 + semver: 7.7.2 package-manager-detector@0.2.9: {} @@ -21588,6 +21599,22 @@ snapshots: tar-fs: 2.1.1 tunnel-agent: 0.6.0 + prebuild-install@7.1.3: + dependencies: + detect-libc: 2.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.6 + mkdirp-classic: 0.5.3 + napi-build-utils: 2.0.0 + node-abi: 3.62.0 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + optional: true + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -21866,7 +21893,7 @@ snapshots: readable-stream@3.6.0: dependencies: inherits: 2.0.4 - string_decoder: 1.1.1 + string_decoder: 1.3.0 util-deprecate: 1.0.2 readable-stream@4.7.0: @@ -22111,7 +22138,7 @@ snapshots: sembear@0.7.0: dependencies: - semver: 7.7.1 + semver: 7.7.2 semiver@1.1.0: {} From 20a70d0b92cd326e8e553f1c5a515e258d23df5b Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 02:46:25 +0100 Subject: [PATCH 08/14] skip node 24 --- .github/workflows/test-and-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index c0fc89ff7862..7fe69ad3c8ac 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -105,10 +105,10 @@ jobs: label: v22, Linux node_version: 22 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' - - os: ubuntu-24.04-arm - label: v24, Linux - node_version: 24 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' + # - os: ubuntu-24.04-arm + # label: v24, Linux + # node_version: 24 + # filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' runs-on: ${{ matrix.os }} steps: From c0e9e7e84e95869ec5149b2363c616a3a189448a Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 13:18:28 +0100 Subject: [PATCH 09/14] skip test --- .github/workflows/test-and-check.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 7fe69ad3c8ac..08b6d7af97bc 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -104,11 +104,11 @@ jobs: - os: ubuntu-24.04-arm label: v22, Linux node_version: 22 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' - # - os: ubuntu-24.04-arm - # label: v24, Linux - # node_version: 24 - # filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler"' + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' + - os: ubuntu-24.04-arm + label: v24, Linux + node_version: 24 + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' runs-on: ${{ matrix.os }} steps: From d65473bdbc1dd18d1e586a2a875e22075758cddd Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 13:26:41 +0100 Subject: [PATCH 10/14] Simplify PR validation --- .github/pull_request_template.md | 4 --- tools/deployments/validate-pr-description.ts | 36 ++------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 958f6a6eb704..9eccbf39394f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,15 +10,11 @@ The following selections do not need to be completed if this PR only contains ch --> - Tests - - [ ] TODO (before merge) - [ ] Tests included - - [ ] Tests not necessary because: - Public documentation - - [ ] TODO (before merge) - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: - Wrangler V3 Backport - - [ ] TODO (before merge) - [ ] Wrangler PR: - [ ] Not necessary because: diff --git a/tools/deployments/validate-pr-description.ts b/tools/deployments/validate-pr-description.ts index 9391e245f93d..4b92f60e9e08 100644 --- a/tools/deployments/validate-pr-description.ts +++ b/tools/deployments/validate-pr-description.ts @@ -41,43 +41,11 @@ export function validateDescription( return []; } - if (/- \[x\] TODO \(before merge\)/i.test(body)) { - errors.push( - "All TODO checkboxes in your PR description must be unchecked before merging" - ); - } - - if ( - !( - /- \[x\] Tests included/i.test(body) || - /- \[x\] Tests not necessary because: .+/i.test(body) - ) - ) { - errors.push( - "Your PR must include tests, or provide justification for why no tests are required" - ); - } - - if (/- \[x\] I don't know/i.test(body)) { - errors.push( - "Your PR cannot be merged with a status of `I don't know` for e2e tests. When your PR is reviewed by the Wrangler team they'll decide whether e2e tests need to be run" - ); - } - if ( - !( - /- \[x\] Required/i.test(body) || - /- \[x\] Not required because: .+/i.test(body) - ) + !(/- \[x\] Tests included/i.test(body) || parsedLabels.includes("no-tests")) ) { errors.push( - "Your PR must run E2E tests, or provide justification for why running them is not required" - ); - } - - if (/- \[x\] Required/i.test(body) && !parsedLabels.includes("e2e")) { - errors.push( - "Since your PR requires E2E tests to be run, it needs to have the `e2e` label applied on GitHub" + "Your PR must include tests, or provide justification for why no tests are required in the PR description and apply the `no-tests` label" ); } From ae741b7a94ad5b5745e3451acfe37e82f5059381 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 13:38:14 +0100 Subject: [PATCH 11/14] fix tool tests --- .../__tests__/validate-pr-description.test.ts | 240 ++++-------------- 1 file changed, 51 insertions(+), 189 deletions(-) diff --git a/tools/deployments/__tests__/validate-pr-description.test.ts b/tools/deployments/__tests__/validate-pr-description.test.ts index f83daae70993..23020d706c4c 100644 --- a/tools/deployments/__tests__/validate-pr-description.test.ts +++ b/tools/deployments/__tests__/validate-pr-description.test.ts @@ -12,37 +12,37 @@ describe("validateDescription()", () => { expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes #[insert GH or internal issue number(s)]. +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - [ ] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [ ] Not required because: - Public documentation - - [x] TODO (before merge) - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: - Wrangler V3 Backport - - [x] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [ ] Not necessary because: + - [ ] Wrangler PR: + - [ ] Not necessary because: + + `, "[]", "[]" ) ).toMatchInlineSnapshot(` [ - "All TODO checkboxes in your PR description must be unchecked before merging", - "Your PR must include tests, or provide justification for why no tests are required", - "Your PR must run E2E tests, or provide justification for why running them is not required", + "Your PR must include tests, or provide justification for why no tests are required in the PR description and apply the \`no-tests\` label", "Your PR doesn't include a changeset. Either include one (following the instructions in CONTRIBUTING.md) or add the 'no-changeset-required' label to bypass this check. Most PRs should have a changeset, so only bypass this check if you're sure that your change doesn't need one: see https://github.com/cloudflare/workers-sdk/blob/main/CONTRIBUTING.md#changesets for more details.", "Your PR must include documentation (in the form of a link to a Cloudflare Docs issue or PR), or provide justification for why no documentation is required", "Your PR must include a v3 back-port (in the form of a link to a workers-sdk PR), or provide justification for why this is not required. A PR should automatically be opened up for you if this is required - this is only needed for patch changes to Wrangler (excluding experimental features labelled as \`patch\`).", @@ -50,65 +50,68 @@ Fixes #[insert GH or internal issue number(s)]. `); }); - it("should bypass changesets check with label", () => { + it("should bypass changesets + tests check with label", () => { expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes #[insert GH or internal issue number(s)]. +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [x] Not required because: test + - [ ] Tests included - Public documentation - - [ ] TODO (before merge) - [ ] Cloudflare docs PR(s): - [x] Documentation not necessary because: test - Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 + - [ ] Wrangler PR: - [x] Not necessary because: test -`, - '["no-changeset-required"]', + +`, + '["no-changeset-required", "no-tests"]', "[]" ) - ).toHaveLength(0); + ).toMatchInlineSnapshot(`[]`); }); it("should accept everything included", () => { expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [x] Not required because: test - Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: + - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/100 + - [ ] Documentation not necessary because: test - Wrangler V3 Backport - - [ ] TODO (before merge) - - [x] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [ ] Not necessary because: + - [x] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/100 + - [ ] Not necessary because: test + + `, "[]", '[".changeset/hello-world.md"]' @@ -149,147 +152,6 @@ Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). ).toHaveLength(0); }); - it("should not accept e2e unknown", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [x] I don't know - - [ ] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - "[]", - '[".changeset/hello-world.md"]' - ) - ).toMatchInlineSnapshot(` - [ - "Your PR cannot be merged with a status of \`I don't know\` for e2e tests. When your PR is reviewed by the Wrangler team they'll decide whether e2e tests need to be run", - "Your PR must run E2E tests, or provide justification for why running them is not required", - ] - `); - }); - - it("should not accept e2e without e2e label", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [x] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - "[]", - '[".changeset/hello-world.md"]' - ) - ).toMatchInlineSnapshot(` - [ - "Since your PR requires E2E tests to be run, it needs to have the \`e2e\` label applied on GitHub", - ] - `); - }); - - it("should accept e2e with e2e label", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [x] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - '["e2e"]', - '[".changeset/hello-world.md"]' - ) - ).toHaveLength(0); - }); - - it("should accept e2e with e2e label - uppercase X", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [X] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [X] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [X] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - '["e2e"]', - '[".changeset/hello-world.md"]' - ) - ).toHaveLength(0); - }); - it("should not accept v3 back port none", () => { expect( validateDescription( From 0aa66ba5b4d4624c026383f7fa682d3e322647e7 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Wed, 25 Jun 2025 15:21:30 +0100 Subject: [PATCH 12/14] re-skip 24 --- .github/workflows/test-and-check.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 08b6d7af97bc..1b7ad880657b 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -105,10 +105,11 @@ jobs: label: v22, Linux node_version: 22 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' - - os: ubuntu-24.04-arm - label: v24, Linux - node_version: 24 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' + # Skipped until we upgrade to undici v7, because of https://github.com/nodejs/undici/issues/4285 + # - os: ubuntu-24.04-arm + # label: v24, Linux + # node_version: 24 + # filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' runs-on: ${{ matrix.os }} steps: From a693002173c71dcdf32d48f5d230a5ec6e872d6e Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Thu, 26 Jun 2025 10:52:56 +0100 Subject: [PATCH 13/14] address review comments --- .github/pull_request_template.md | 1 + .github/workflows/c3-e2e.yml | 11 +++++------ .github/workflows/e2e.yml | 17 ++++++++--------- .github/workflows/open-v3-maintenance-prs.yml | 3 ++- .github/workflows/test-and-check.yml | 13 ++++++------- .../__tests__/validate-pr-description.test.ts | 7 +++++-- tools/deployments/validate-pr-description.ts | 5 ++++- 7 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9eccbf39394f..732a30f4e2f0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,6 +11,7 @@ The following selections do not need to be completed if this PR only contains ch - Tests - [ ] Tests included + - [ ] Tests not necessary because: - Public documentation - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: diff --git a/.github/workflows/c3-e2e.yml b/.github/workflows/c3-e2e.yml index 4988a639ea7d..6526548ce9f0 100644 --- a/.github/workflows/c3-e2e.yml +++ b/.github/workflows/c3-e2e.yml @@ -2,7 +2,6 @@ name: E2E on: merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] env: # TODO: switch back to 20.x onces node@20.x includes a fix for https://github.com/nodejs/node/issues/57869 @@ -16,22 +15,22 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} cancel-in-progress: true - name: ${{ format('C3 ({0})', matrix.label) }} + name: ${{ format('C3 ({0})', matrix.description) }} strategy: fail-fast: false matrix: include: - os: windows-latest - label: pnpm, Windows + description: pnpm, Windows pm: { name: pnpm, version: "9.12.0" } - os: ubuntu-latest - label: npm, Linux + description: npm, Linux pm: { name: npm, version: "0.0.0" } - os: ubuntu-latest - label: yarn, Linux + description: yarn, Linux pm: { name: yarn, version: "1.0.0" } - os: ubuntu-latest - label: pnpm, Linux + description: pnpm, Linux pm: { name: pnpm, version: "9.12.0" } runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 94a7126760e3..edd1a6c9a0f9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,11 +3,10 @@ name: E2E on: merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] jobs: e2e-wrangler-test: - name: ${{ format('Wrangler ({0})', matrix.label) }} + name: ${{ format('Wrangler ({0})', matrix.description) }} concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-wrangler cancel-in-progress: true @@ -17,13 +16,13 @@ jobs: matrix: include: - os: macos-13 - label: v20, macOS + description: v20, macOS node: 20.19.1 - os: windows-2022 - label: v20, Windows + description: v20, Windows node: 20.19.1 - os: ubuntu-22.04-arm - label: v20, Linux + description: v20, Linux node: 20.19.1 runs-on: ${{ matrix.os }} @@ -72,7 +71,7 @@ jobs: path: .turbo/runs e2e-vite-test: - name: ${{ format('Vite ({0})', matrix.label) }} + name: ${{ format('Vite ({0})', matrix.description) }} concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-vite cancel-in-progress: true @@ -81,13 +80,13 @@ jobs: matrix: include: - os: macos-13 - label: v20, macOS + description: v20, macOS node: 20.19.1 - os: windows-2022 - label: v20, Windows + description: v20, Windows node: 20.19.1 - os: ubuntu-22.04-arm - label: v20, Linux + description: v20, Linux node: 20.19.1 runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/open-v3-maintenance-prs.yml b/.github/workflows/open-v3-maintenance-prs.yml index 2a86036b899d..10da8de47a1d 100644 --- a/.github/workflows/open-v3-maintenance-prs.yml +++ b/.github/workflows/open-v3-maintenance-prs.yml @@ -2,7 +2,8 @@ name: v3 Maintenance on: pull_request: - branches: main + branches: + - main types: [synchronize, opened, reopened, labeled, unlabeled] paths: - ".changeset/**.md" diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 1b7ad880657b..bdeba5ccf4b8 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -3,7 +3,6 @@ name: CI on: merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] jobs: add-to-project: @@ -83,26 +82,26 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test cancel-in-progress: true - name: ${{ format('Tests ({0})', matrix.label) }} + name: ${{ format('Tests ({0})', matrix.description) }} strategy: fail-fast: false matrix: include: - os: macos-latest - label: v20, macOS + description: v20, macOS node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - os: ubuntu-24.04-arm - label: v20, Linux + description: v20, Linux node_version: 20.19.1 # ./tools _only_ runs here because they're only intended to run in CI filter: '--filter="./tools" --filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: windows-latest - label: v20, Windows + description: v20, Windows node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: ubuntu-24.04-arm - label: v22, Linux + description: v22, Linux node_version: 22 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' # Skipped until we upgrade to undici v7, because of https://github.com/nodejs/undici/issues/4285 @@ -149,7 +148,7 @@ jobs: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.label }} + CI_OS: ${{ matrix.description }} - name: Upload turbo logs if: always() diff --git a/tools/deployments/__tests__/validate-pr-description.test.ts b/tools/deployments/__tests__/validate-pr-description.test.ts index 23020d706c4c..9ddb9cac0e05 100644 --- a/tools/deployments/__tests__/validate-pr-description.test.ts +++ b/tools/deployments/__tests__/validate-pr-description.test.ts @@ -25,6 +25,7 @@ The following selections do not need to be completed if this PR only contains ch - Tests - [ ] Tests included + - [ ] Tests not necessary because: - Public documentation - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: @@ -50,7 +51,7 @@ In particular, for non-trivial changes, please always engage on the issue or cre `); }); - it("should bypass changesets + tests check with label", () => { + it("should bypass changesets check with label", () => { expect( validateDescription( "", @@ -67,6 +68,7 @@ The following selections do not need to be completed if this PR only contains ch - Tests - [ ] Tests included + - [x] Tests not necessary because: test - Public documentation - [ ] Cloudflare docs PR(s): - [x] Documentation not necessary because: test @@ -78,7 +80,7 @@ The following selections do not need to be completed if this PR only contains ch Have you read our [Contributing guide](https://github.com/cloudflare/workers-sdk/blob/main/CONTRIBUTING.md)? In particular, for non-trivial changes, please always engage on the issue or create a discussion or feature request issue first before writing your code. -->`, - '["no-changeset-required", "no-tests"]', + '["no-changeset-required"]', "[]" ) ).toMatchInlineSnapshot(`[]`); @@ -101,6 +103,7 @@ The following selections do not need to be completed if this PR only contains ch - Tests - [x] Tests included + - [ ] Tests not necessary because: - Public documentation - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/100 - [ ] Documentation not necessary because: test diff --git a/tools/deployments/validate-pr-description.ts b/tools/deployments/validate-pr-description.ts index 4b92f60e9e08..9daf07f4659f 100644 --- a/tools/deployments/validate-pr-description.ts +++ b/tools/deployments/validate-pr-description.ts @@ -42,7 +42,10 @@ export function validateDescription( } if ( - !(/- \[x\] Tests included/i.test(body) || parsedLabels.includes("no-tests")) + !( + /- \[x\] Tests included/i.test(body) || + /- \[x\] Tests not necessary because: .+/i.test(body) + ) ) { errors.push( "Your PR must include tests, or provide justification for why no tests are required in the PR description and apply the `no-tests` label" From 8d729e1fc78430644f699a48cb5ff72ba9d5f9c7 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Thu, 26 Jun 2025 11:25:53 +0100 Subject: [PATCH 14/14] match existing test names --- .github/workflows/test-and-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index bdeba5ccf4b8..e615b811611d 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -88,16 +88,16 @@ jobs: matrix: include: - os: macos-latest - description: v20, macOS + description: macOS node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - os: ubuntu-24.04-arm - description: v20, Linux + description: Linux node_version: 20.19.1 # ./tools _only_ runs here because they're only intended to run in CI filter: '--filter="./tools" --filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: windows-latest - description: v20, Windows + description: Windows node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: ubuntu-24.04-arm