Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2025
Merged

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jul 21, 2025

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 review from a team as code owners July 21, 2025 12:42
Copy link

changeset-bot bot commented Jul 21, 2025

🦋 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

Copy link
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

Copy link

pkg-pr-new bot commented Jul 21, 2025

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

@vicb vicb added the skip-v3-pr Skip validation of presence of a v3 backport PR label Jul 21, 2025
@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
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

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

@vicb vicb force-pushed the vicb/unenv-tests branch 2 times, most recently from a56d5a7 to 84944bd Compare July 22, 2025 11:42
@vicb
Copy link
Contributor Author

vicb commented Jul 22, 2025

@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
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

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
Copy link
Contributor Author

vicb commented Jul 23, 2025

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
skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants