-
Notifications
You must be signed in to change notification settings - Fork 925
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
Conversation
|
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: |
beaa63e
to
fe30f4f
Compare
fe30f4f
to
0d8f45e
Compare
// 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, |
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.
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)
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.
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` |
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 think --platform
is accepted here
"wrangler.json": JSON.stringify(wranglerConfig), | ||
}); | ||
// cleanup any running containers | ||
const ids = getContainerIds(); |
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.
Would this be cleaning all my local containers when I run the 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.
ah yeah good point, will filter
// cleanup any running containers | ||
const ids = getContainerIds(); | ||
if (ids.length > 0) { | ||
execSync("docker rm -f " + ids.join(" "), { |
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.
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)
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.
good point i'll pull in the WRANGLER_DOCKER_BIN env var
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.
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.
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.