Commit graph

33 commits

Author SHA1 Message Date
Somhairle MacLeòid
f3871f8c25
[wrangler] Shard E2E tests across 4 parallel CI jobs (#12941) 2026-03-20 10:01:03 +00:00
Somhairle MacLeòid
aa26784ce1
Convert from ESLint to oxlint, Prettier to oxfmt (#12930) 2026-03-18 16:03:35 +00:00
emily-shen
dd78eb5afa
skip next c3 tests on forks and cleanup r2 buckets from e2e tests (#12699) 2026-02-27 16:46:54 +00:00
Victor Berchet
5e89bd1662
refactor: consistenly import expect from vitest (#11851)
* refactor: consistenly import expect from vitest

* fixup!
2026-01-09 15:15:40 +00:00
Dario Piotrowicz
caf94dbfff
chore: add eslint rule for requiring node: prefix in node imports (#11411) 2025-11-26 15:47:03 +00:00
Pete Bacon Darwin
17cea9c815
ci: fix the cleanup script which stopped working for Pages projects (#11401)
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.
2025-11-25 10:38:12 +00:00
Victor Berchet
1acd43d044
fix the e2e retry logic (#11399) 2025-11-25 10:53:59 +01:00
Pete Bacon Darwin
40ce5f9c61
test: add more retries to e2e tests (#11320)
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.
2025-11-18 13:19:58 +00:00
Somhairle MacLeòid
4be581af7d
Use eslint flat file config (#11207)
* Use eslint flat file config

* prettify

* fix

* address some comments
2025-11-07 13:15:59 +00:00
Pete Bacon Darwin
544613579c
Run cleanup every 2 hours and only cleanup kvs that are older than an hour (#10323) 2025-09-28 11:52:49 +01:00
Pete Bacon Darwin
b45cffe522
chore: improvements to remote-bindings tests to reduce flakes (#10380)
* 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>
2025-09-22 14:07:54 +01:00
Victor Berchet
a341101786
make sure we run wrangler e2e tests in nested folders (#10174) 2025-08-01 12:34:32 +02:00
Pete Bacon Darwin
64af5da727
Further updates to e2e test running helpers and instructions (#9969)
* further updates to e2e test running helpers and instructions

* Update packages/wrangler/e2e/README.md

Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>

---------

Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
2025-07-15 14:31:36 +01:00
Pete Bacon Darwin
d609ac7823
update eslint versions and ban direct console usage in Wrangler, Miniflare and C3 (#9861)
* 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
2025-07-15 09:33:30 +01:00
Dario Piotrowicz
c79a52770f
update the e2e cleanup script to also delete container images (#9939) 2025-07-14 09:55:40 +01:00
Pete Bacon Darwin
6af530d969
do not delete the existing-script-test-do-not-delete Worker (#9853) 2025-07-04 12:23:11 +00:00
Somhairle MacLeòid
57d3d01e3d
Skip remote E2E tests when no auth available (#9826)
* Make E2E's easier to run locally

* Skip local E2Es

* fork workflow

* Improve contributing docs for E2E

* change spreading
2025-07-03 15:50:13 +00:00
Somhairle MacLeòid
f545a4dd9a
Remove more workers in E2E cleanup (#9823)
* Remove more workers

* fix test

* shorter worker names
2025-07-02 21:42:46 +00:00
Pete Bacon Darwin
ddeeefd0c7
test: correctly delete test d1 databases (#9598)
* test: correctly delete test d1 databases

* bunch of other tidy-ups and fixes in the e2eCleanup code
2025-06-13 15:23:58 +00:00
Pete Bacon Darwin
fb88a832ba
ci: delete more orphaned resources from e2e tests (#9580)
* 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
2025-06-12 17:15:51 +00:00
Pete Bacon Darwin
40dd603b8e
test: re-use build cache in Wrangler e2e test runs (#9411)
* 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
2025-05-30 14:50:43 +00:00
Pete Bacon Darwin
ad3d0f9a81
ci: remove redundant e2e cleanup job (#9375)
* ci: remove redundant e2e cleanup job

* remove false error from deleting d1 databases
2025-05-30 11:42:00 +00:00
Pete Bacon Darwin
4f2c1ed542
ci: run Wrangler e2e tests twice to reduce flakes (#9287) 2025-05-16 15:18:08 +00:00
Gabi
078c568c2b
wrangler containers: wrangler deploy should be able to deploy container applications (#8985)
* 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)
2025-05-06 10:34:34 -05:00
emily-shen
da9f8db63a
Fix e2e hyperdrive cleanup + logging (#8941)
* fix e2e cleanup

* Apply suggestions from code review

Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>

---------

Co-authored-by: Edmund Hung <edmund@cloudflare.com>
Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>
2025-04-24 15:32:19 +02:00
Edmund Hung
f00775126b
chore: cleanup e2e test certs (#8936) 2025-04-16 11:52:02 +01:00
Pete Bacon Darwin
d429661252
test: add console log "grouping" to Wrangler e2e tests (#8455)
This should make it easier to see what is happening in CI.
2025-03-20 13:28:31 +00:00
emily-shen
c7bc2ba95d
chore: cleanup e2e hyperdrive configs (#8306)
* hyperdrive cleanup task

* fix actual problem
2025-02-28 19:53:50 +00:00
emily-shen
cf424bb8e1
chore: delete more orphaned e2e resources (#7708)
* increase page size

* fix tests
2025-01-09 13:15:25 +00:00
emily-shen
a7b04884d6
chore: add d1 and kv to e2e cleanup job (#7681)
* add d1 and kv to e2e cleanup job

* add d1 and kv to cleanup

* tests
2025-01-07 11:55:40 +00:00
Somhairle MacLeòid
aa0aa4794c
fixup: Add --output-logs=new-only to e2e script (#6209)
* fewer logs
2024-07-08 21:41:30 +01:00
Somhairle MacLeòid
c6c083f346
Granular e2e caching (#6201) 2024-07-05 15:06:05 +01:00
Pete Bacon Darwin
c9a8224196
ci: ensure that both C3 and DevProd accounts are cleaned up after e2e… (#5781)
* 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
2024-05-09 07:30:30 +01:00