Something about the `per_page` parameter seems to cause the listing of Pages projects to respond with a 400 Bad Request. Removing it and going with the default seems fine.
We will now retry wrangler e2e tests up to 4 times.
Also we batch them up so that we don't necessarily retry the previously failed test immediately, since this could actually be a source of the flake.
* chore: improvements to remote-bindings tests to reduce flakes
* retry wrangler-remote-resources checks a few times
* move the getPlatformProxy remote-bindings tests to the e2e CI job
* move `startDev` into its own module so it is possible to mock it
* move `startRemoteProxySession` into its own module so it is possible to mock it
* add missing types to `Binding` type
* add missing `remote` property and update jsdoc for Config type
* Allow config watching in unit tests
The tests were previously failing because the controller had not been been torn down before the end of the test, rather than the actual watching being a problem in itself.
When the tests end, the current working directory gets reverted from the temporary directory that was created for it. Since the controller had not been torn down, the config file change triggered a config change event which then tries to read the config from the wrong current working directory, causing an exception.
* Remove wrangler-remote-resources e2e test
This is now covered by a combination of:
- `packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts` - actually tests that we can create, deploy and connect to the remote dev session worker.
- `packages/wrangler/src/__tests__/dev/remote-bindings.test.ts` - tests that we generate the correct config for the remote session proxy worker and local miniflare session.
The removed e2e test was very flaky and slow as it required creating and deleting a lot of resources in Cloudflare.
The new test runs entirely without any dependency on Cloudflare and is super fast (<20 secs).
* add Wrangler remote bindings unit tests
* ensure configcontroller is torn down before tmp directory is deleted
* wait for config watching to be updated
* ignore changes if the watcher is closed
* Allow the "too large" upload test more time to pass
Sometimes timesout on Windows
* abort if this config controller is no longer viable
* remove unnecessary `console.dir()` calls in tests
* update ubuntu in CI tests
* run wrangler tests before fixtures
* Update packages/wrangler/e2e/helpers/e2e-wrangler-test.ts
Co-authored-by: Dario Piotrowicz <dario@cloudflare.com>
* run all linux tests on ubuntu 24
---------
Co-authored-by: Dario Piotrowicz <dario@cloudflare.com>
* update eslint versions and ban direct console usage in Wrangler, Miniflare and C3
* fixup! update eslint versions and ban direct console usage in Wrangler, Miniflare and C3
* fixup! update eslint versions and ban direct console usage in Wrangler, Miniflare and C3
* fixup! update eslint versions and ban direct console usage in Wrangler, Miniflare and C3
* rebase catchups of new eslint errors
* ci: delete more orphaned resources from e2e tests
We were not getting all pages of results from the backend.
* Remove rendundant type param
* fix eslint error
* test: re-use build cache in Wrangler e2e test runs
Since we were running each test file individually by passing a command line argument to the turbo task, we were not benefitting from the cached builds of the dependencies.
This change moves the selection of a test file into an environment variable that is ignored by build tasks, allowing reuse of their cached output.
Since rebuilding adds 30-60 secs to each task, and there being 20 or so tests, this change should reduce the CI e2e test times by 10-20 mins!
* skip vite-plugin mixed-mode e2e tests on Windows
* wrangler containers: wrangler deploy should be able to deploy container
applications
We are adding a new step into wrangler deploy that allows the user to
deploy container applications through wrangler deploy.
The main changes on this commit allow:
1. cloudchamber/build.ts to accomodate the needs of the new deploy path
of containers.
2. cloudchamber/apply.ts to create a Cloudchamber rollout.
3. deploy.ts to call a method when containers option is defined.
This method in cloudchamber/deploy.ts does the following:
1. Call fetchVersion to know what's the namespace_id of the target
DOs.
2. Deploy each container application.
Each container application might specify a Dockerfile or an image
URI. If it's a Dockerfile, we will read it and build it.
* wrangler containers: Move 'crash' to UserError and format correctly all comemnts around Container types
* rename parameters on getBuildArguments to clarify that its for the image tag
* address comments:
1. docker path
2. image parts
3. user error when no DO referenced by deploy
4. filter() -> find()
5. move from wrap() to try/catch
6. throw user error instead when image ref does not contain tag
* user error on reading Dockerfile
* getBuildArguments test and improve error handling messages
* add a test that mocks the 'docker' command line and checks all calls to docker are correct
* add e2e tests
* application diff should not show instances modification if using max_instances
* print application id on creation and cleanup created applications and
add Dockerfile to gitignore
* set instances to optional, accept max_instances, make sure that we do not render instances in diff if using max_instances
* instances should be omitted in the diff
* apply latest suggestions (no imports in e2e and reduce timeout to 3m)
* ci: ensure that both C3 and DevProd accounts are cleaned up after e2e tests
Previously we were only deleting stale projects/workers from the C3 test account.
* fixup! ci: ensure that both C3 and DevProd accounts are cleaned up after e2e tests