Skip to content

Move the unenv tests from the preset to wrangler e2e - #10031

Merged
vicb merged 4 commits into
mainfrom
vicb/unenv-tests
Jul 23, 2025
Merged

Move the unenv tests from the preset to wrangler e2e#10031
vicb merged 4 commits into
mainfrom
vicb/unenv-tests

Conversation

@vicb

@vicb vicb commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Move the preset tests from the preset package to wrangler e2e.

This is done to allow removing the dependency from the preset to wrangler so that wrangler can depend on the workspace version of the preset.

The tests now run both locally and in prod.

/cc @petebacondarwin @edmundhung @jamesopstad


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: refactoring
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: preset change

@vicb
vicb requested a review from a team as a code owner July 21, 2025 12:42
@vicb
vicb requested a review from a team July 21, 2025 12:42
@changeset-bot

changeset-bot Bot commented Jul 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1af08d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/vite-plugin Patch
@cloudflare/unenv-preset Patch
wrangler Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main vicb/unenv-tests might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10031
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2025

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10031

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10031

miniflare

npm i https://pkg.pr.new/miniflare@10031

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10031

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10031

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10031

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10031

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10031

wrangler

npm i https://pkg.pr.new/wrangler@10031

commit: a1af08d

Comment thread packages/unenv-preset/README.md Outdated
Comment thread packages/vite-plugin-cloudflare/package.json Outdated
Comment thread packages/wrangler/.eslintrc.js Outdated
Comment thread packages/wrangler/e2e/tsconfig.json Outdated
Comment thread packages/wrangler/e2e/unenv-preset/tsconfig.json Outdated
Comment thread packages/wrangler/package.json Outdated
Comment thread .changeset/gold-beans-tie.md Outdated
Comment thread packages/wrangler/e2e/unenv-preset/worker/index.ts Outdated
@github-project-automation github-project-automation Bot moved this from Untriaged to In Review in workers-sdk Jul 21, 2025
@vicb
vicb force-pushed the vicb/unenv-tests branch from 2478fe8 to 687d368 Compare July 22, 2025 06:49
@vicb
vicb requested a review from petebacondarwin July 22, 2025 06:50

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather we don't mix Worker code and Node.js test in the same tsconfig set up.
The seed-files directory is already the place for this sort of thing.
I think we should have something here more along the lines of this: vicb/unenv-tests...pbd/unenv-tests-alt

Comment thread packages/wrangler/.eslintrc.js Outdated
Comment thread packages/wrangler/e2e/tsconfig.json Outdated
@vicb
vicb force-pushed the vicb/unenv-tests branch 2 times, most recently from a56d5a7 to 84944bd Compare July 22, 2025 11:42
@vicb

vicb commented Jul 22, 2025

Copy link
Copy Markdown
Contributor Author

@petebacondarwin I have refactored the code to remove changes to the eslint config.

The changes in tsconfig.jsons match what's usually done across the repo: exclude nest folders when they store their own tsconfig.json.

PTAL

@vicb
vicb requested a review from petebacondarwin July 22, 2025 12:05
@vicb
vicb force-pushed the vicb/unenv-tests branch from 84944bd to 3e62de3 Compare July 22, 2025 16:12
@vicb
vicb force-pushed the vicb/unenv-tests branch from 3e62de3 to 596094e Compare July 23, 2025 10:59
@vicb
vicb force-pushed the vicb/unenv-tests branch from ab022bc to d648946 Compare July 23, 2025 12:08

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK let's go with this.
Did you see, by the way, in my side branch, that you can simplify the remote tests quite a lot by using wrangler dev --remote? It saves having to create and delete a Worker in each test.

@github-project-automation github-project-automation Bot moved this from In Review to Approved in workers-sdk Jul 23, 2025
@vicb

vicb commented Jul 23, 2025

Copy link
Copy Markdown
Contributor Author

OK let's go with this.
Did you see, by the way, in my side branch, that you can simplify the remote tests quite a lot by using wrangler dev --remote? It saves having to create and delete a Worker in each test.

No I didn't.
I'll take another look and brings in stuff from there in a follow up PR.

Thanks for the reviews and feedback!

@vicb
vicb merged commit 823cba8 into main Jul 23, 2025
31 checks passed
@vicb
vicb deleted the vicb/unenv-tests branch July 23, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants