-
Notifications
You must be signed in to change notification settings - Fork 935
[vitest-pool-workers] Fix Workflow binding's script_name when it matches its own Worker name #10033
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
[vitest-pool-workers] Fix Workflow binding's script_name when it matches its own Worker name #10033
Conversation
🦋 Changeset detectedLatest commit: dbf9e1d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
e7a36a3
to
f4d51dc
Compare
7b1a2d8
to
ae0a9c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved from the workflows team.
I think the name is available under |
but if Pete's suggestion to strip out the name works, that'd be great as its much simpler |
I think we'd still need to know the Worker name in case it is actually pointing to a different Worker not itself? |
oh sorry fair enough - i guess check if it matches project.project.name, and strip it out if it does? |
Yes, I'll do it, however I'm not able to get the worker name through project.project.name. It actually returns nothing |
…name matches its own Worker name removing try catch since error gets thrown either way use userConfigPath instead of redirected one (#10005) Revert "use userConfigPath instead of redirected one (#10005)" This reverts commit 5c11fe7. fix deep import prettier run fix: make vitest-pool-workers not break if Workflow binding's script_name matches its own Worker name
3cdd607
to
dbf9e1d
Compare
Fixes WOR-760.
A user can define a Workflow binding where the
script_name
is the same as the name of the Worker on which the binding is defined. Although redundant, it should be supported.vitest-pool-workers
breaks because it does not use the user's Worker as the test entrypoint. It uses its own runner worker, which has a different name generated before execution. This leads to a mismatch between thescript_name
in the binding and the Worker that will run.To fix this, the code now checks it a workflow binding's
script_name
matches its own Worker's name. When it does,script_name
is removed, making it default to the current worker.