Skip to content

Commit

Permalink
Pack miniflare for e2e (#4458)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Nov 16, 2023
1 parent 05b1bbd commit 2be0f3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@ jobs:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build Wrangler package for npm
- name: Pack Miniflare
run: pnpm pack --pack-destination $HOME
env:
NODE_ENV: "production"
working-directory: packages/miniflare

- name: Modify wrangler package.json miniflare dependency
run: pnpm add $(ls $HOME/miniflare-*.tgz)
working-directory: packages/wrangler

- name: Pack Wrangler
run: pnpm pack --pack-destination $HOME
env:
NODE_ENV: "production"
Expand All @@ -62,8 +72,6 @@ jobs:
shell: bash
id: "find-wrangler"
run: echo "dir=$(ls $HOME/wrangler-*.tgz)" >> $GITHUB_OUTPUT;
env:
NODE_ENV: "production"

- name: Run tests
id: e2e-1
Expand All @@ -74,12 +82,3 @@ jobs:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
WRANGLER: pnpm --silent --package ${{ steps.find-wrangler.outputs.dir}} dlx wrangler
NODE_OPTIONS: "--max_old_space_size=8192"

- name: Retry tests
if: steps.e2e-1.outcome == 'failure'
run: pnpm run --filter wrangler test:e2e
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
WRANGLER: pnpm --silent --package ${{ steps.find-wrangler.outputs.dir}} dlx wrangler
NODE_OPTIONS: "--max_old_space_size=8192"
2 changes: 1 addition & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"test": "pnpm run assert-git-version && jest",
"test:ci": "pnpm run test --coverage",
"test:debug": "pnpm run test --silent=false --verbose=true",
"test:e2e": "vitest --test-timeout 240000 --single-thread --dir ./e2e run",
"test:e2e": "vitest --test-timeout 240000 --single-thread --dir ./e2e --retry 2 run",
"test:watch": "pnpm run test --runInBand --testTimeout=50000 --watch",
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
},
Expand Down

0 comments on commit 2be0f3f

Please sign in to comment.