-
Notifications
You must be signed in to change notification settings - Fork 769
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
chore: Ensure that C3 e2e tests are running against local wrangler #7809
base: main
Are you sure you want to change the base?
Conversation
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-wrangler-7809 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7809/npm-package-wrangler-7809 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-wrangler-7809 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-workers-bindings-extension-7809 -O ./cloudflare-workers-bindings-extension.0.0.0-v15a0aa160.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v15a0aa160.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-create-cloudflare-7809 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-kv-asset-handler-7809 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-miniflare-7809 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-pages-shared-7809 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-unenv-preset-7809 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-vite-plugin-7809 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-vitest-pool-workers-7809 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-workers-editor-shared-7809 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-workers-shared-7809 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12954558317/npm-package-cloudflare-workflows-shared-7809 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
9ed291c
to
3059047
Compare
c17b408
to
7624883
Compare
c2181e6
to
01799a3
Compare
01799a3
to
573796e
Compare
@@ -88,9 +89,14 @@ export async function getLatestPackageVersion(packageSpecifier: string) { | |||
*/ | |||
export const installWrangler = async () => { | |||
const { npm } = detectPackageManager(); | |||
const wrangler = process.env.CI |
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.
Why make this CI only?
What if you make the WRANGLER env var more specific (e.g. C3_WRANGLER_OVERRIDE or something) and then use that as the flag to override the wrangler@latest
?
Then we can use this for local testing too.
|
||
export function packWrangler(): string { | ||
const pathToWrangler = path.resolve(__dirname, "../../wrangler"); | ||
execSync("pnpm pack --pack-destination ./pack", { cwd: pathToWrangler }); |
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.
Unfortunately, this doesn't quite do what we need.
This will pack Wrangler, yes, but it will change the local Wrangler dependencies to published ones. For example,
"miniflare": "workspace:*",
becomes
"miniflare": "3.20241230.2",
which means that when C3 installs this version of Wrangler it will pull in the published miniflare, instead of the locally built one.
This is notably problematic because one of the reasons we wanted to do this was that the transitive dependency on @cloudflare/unenv-preset
that was added did not cause a failure in the C3 tests.
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.
The vitest-pool-workers package has the same problem.
This is how it gets around it: https://github.com/cloudflare/workers-sdk/blob/f3c040016bad4fd4c7a222e9d5f74a1a6207529e/packages/vitest-pool-workers/test/global-setup.ts
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.
I wonder if we could leverage turbo to do that more automatically?
859220b
to
1a3f773
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.
This is good to get us unblocked for releases.
Thanks!
Uurgh!
|
@@ -88,9 +88,10 @@ export async function getLatestPackageVersion(packageSpecifier: string) { | |||
*/ | |||
export const installWrangler = async () => { | |||
const { npm } = detectPackageManager(); | |||
const wrangler = process.env.CI ? `wrangler@beta` : "wrangler@latest"; |
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.
Maybe try:
const wrangler = process.env.CI ? `wrangler@beta` : "wrangler@latest"; | |
const wrangler = process.env.CI ? `wrangler@beta --force` : "wrangler@latest"; |
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.
npm error Invalid tag name "beta --force" of package "wrangler@beta --force": Tags may not have any characters that encodeURIComponent encodes.
😢 unfortunately this breaks tests for all package managers
I like it tho how this is only a problem in |
39d3350
to
5450688
Compare
5450688
to
fc60f0b
Compare
Ensure that C3 e2e tests are running against
wrangler@beta
in CIThis is one smol incremental step towards fixing #7800.