Skip to content

containers local dev e2e tests #9820

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 3 commits into from
Jul 3, 2025
Merged

containers local dev e2e tests #9820

merged 3 commits into from
Jul 3, 2025

Conversation

emily-shen
Copy link
Contributor

@emily-shen emily-shen commented Jul 2, 2025

These tests will also only run in linux in CI, because github runners don't support any container tools (without janky workarounds).

Tests for rebuild hotkey and removing containers on dev session will happen in a followup PR but are currently blocked on a path resolution bug, and i'd like to get some tests in first.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: tests
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: feature doesn't exist in v3

Copy link

changeset-bot bot commented Jul 2, 2025

⚠️ No Changeset found

Latest commit: 01c2a4b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

pkg-pr-new bot commented Jul 2, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 01c2a4b

@emily-shen emily-shen force-pushed the emily/e2e-a-bit branch 2 times, most recently from beaa63e to fe30f4f Compare July 2, 2025 14:09
@emily-shen emily-shen marked this pull request as ready for review July 2, 2025 15:31
@emily-shen emily-shen requested a review from a team as a code owner July 2, 2025 15:31
@emily-shen emily-shen added skip-v3-pr Skip validation of presence of a v3 backport PR no-changeset-required labels Jul 2, 2025
// So we skip these tests in CI, and test this locally for now :/
describe.skipIf(process.platform !== "linux" && process.env.CI === "true")(
"containers local dev tests",
// We can only really run these tests on Linux, because we build our images for linux/amd64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do changing the os in e2e.yml has side effects?

Could another be to pass the platform to the bulid command? (I think there is an option, not sure if settable here)

Copy link
Contributor Author

@emily-shen emily-shen Jul 3, 2025

Choose a reason for hiding this comment

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

we always build for linux/amd64 at dev and deploy time, so i don't think we can/should change that. changing the CI os shouldn't make a difference, apparently it might be marginally slower but we don't really have any other options. we've used the amd runners in the past.

if (source === "pull") {
// pull a container image from the registry
await helper.run(
`wrangler containers build . -t ${workerName}:tmp-e2e -p`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think --platform is accepted here

"wrangler.json": JSON.stringify(wranglerConfig),
});
// cleanup any running containers
const ids = getContainerIds();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be cleaning all my local containers when I run the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yeah good point, will filter

// cleanup any running containers
const ids = getContainerIds();
if (ids.length > 0) {
execSync("docker rm -f " + ids.join(" "), {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is docker ok when running locally or should we provide a way to override the location (not sure what we do with the wrangler commands)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point i'll pull in the WRANGLER_DOCKER_BIN env var

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

LGTM.

2 main things:

  • Does changing e2e os has side effects - IMO we should try to avoid if setting --platform work
  • IIUC the PR would rm all the containers on my local machine when running the tests locally, not nice

A few minor comments.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jul 2, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 3, 2025
Merged via the queue into main with commit f064f01 Jul 3, 2025
31 checks passed
@emily-shen emily-shen deleted the emily/e2e-a-bit branch July 3, 2025 15:21
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changeset-required skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants