workers-sdk/tools/README.md
devin-ai-integration[bot] 911fd8d109
ci: ensure existing-script-test-do-not-delete worker exists before C3 E2E tests (#10272)
* ci: ensure existing-script-test-do-not-delete worker exists before C3 E2E tests

Add deployment step to create-cloudflare E2E workflow that deploys the
existing-script-test-do-not-delete worker before tests run. This ensures
the worker exists with the correct configuration (FOO=bar variable and
Hello World response) that the --existing-script test relies on.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Address PR feedback: use wrangler.jsonc, handle fork PRs, check worker existence

- Convert wrangler.toml to wrangler.jsonc format as requested
- Add condition to skip deployment if TEST_CLOUDFLARE_ACCOUNT_ID is not set (handles fork PRs)
- Check if worker exists before deploying to avoid unnecessary deployments

Addresses feedback from @petebacondarwin in PR comments.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Fix worker URL in curl existence check

Use the correct worker URL https://existing-script-test-do-not-delete.devprod-testing7928.workers.dev
as specified by @petebacondarwin in PR comment feedback.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Update condition to check for API token instead of account ID

Change from env.TEST_CLOUDFLARE_ACCOUNT_ID to secrets.TEST_CLOUDFLARE_API_TOKEN
as suggested by @petebacondarwin in PR comment feedback.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Trigger CI to pick up no-changeset-required label

This empty commit forces CI to re-run with the no-changeset-required label
that was added to the PR after the last commit.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Fix GitHub Actions YAML syntax error in worker deployment condition

Replace invalid secrets.TEST_CLOUDFLARE_API_TOKEN check with proper fork detection
pattern used elsewhere in the repository.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Refactor CI to use permanent test worker files from tools/test-workers/

- Move worker definition from inline CI creation to tools/test-workers/existing-script-test-do-not-delete/
- Update C3 E2E workflow to reference permanent worker files instead of creating temporary ones
- Add documentation for test workers in tools/README.md
- Create deploy-all.sh script for future extensibility
- Add .eslintignore to exclude test worker files from strict TypeScript linting
- Maintain same deployment logic with existence check and fork PR handling

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Address PR feedback: convert deployment script to TypeScript and use separate CI job

- Convert tools/test-workers/deploy-all.sh to TypeScript using Node.js patterns
- Move environment variable checks and fetch-based existence check into TypeScript script
- Refactor CI workflow to use separate 'deploy-test-workers' job with needs: dependency
- Use 'node -r esbuild-register' execution pattern following tools/package.json conventions
- Remove trigger_ci.md file which was only for triggering CI
- Maintain all existing functionality while improving maintainability

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Trigger fresh CI validation

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Remove temporary trigger file

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Fix linting issues: remove unused error variable and enable allowJs for test workers

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Add documentation for deploy-all script as requested in PR feedback

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Update README with deploy-all documentation

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* Fix unused @ts-expect-error directive in changeset-version.test.ts

The directive was no longer needed after enabling allowJs in TypeScript config,
causing a compilation error in CI checks.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>

* use `pnpx` rather than `npx`

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: pbacondarwin@cloudflare.com <pete@bacondarwin.com>
2025-08-08 13:13:07 +01:00

1.6 KiB

Continuous Integration (CI) tools

Tools for helping with CI

  • deployments/deploy-non-npm-packages() - Deploy all packages that had updates but are not deployed to npm automatically by the changesets tooling. This is used by the changesets.yml GitHub workflow to deploy non-npm packages (e.g. Workers and Pages projects).

  • deployments/ensure-fixtures-are-not-deployable.ts - Ensures that we don't accidentally create git tags and releases for fixtures by someone inadvertently adding a version to their package.json or making them non-private. Used by test-and-check.yml GitHub Action workflows, as part of the check npm script.

  • deployments/validate-changesets.ts - Validate that changesets are formatted correctly. Used by the changesets.yml and test-and-check.yml GitHub Action workflows.

  • dependabot/generate-dependabot-pr-changesets.ts - Generates and commits a changeset for a Dependabot PR. Used by the c3-dependabot-versioning-prs.yml and miniflare-dependabot-versioning-prs.yml GitHub Action workflows.

  • e2e/e2eCleanup.ts - Ensures that any orphaned Pages projects and Workers that were left behind from e2e tests are deleted.

  • e2e/runIndividualE2EFiles.ts - Used to shard the e2e tests into separately cache-able Turbo runs, which helps with flakey tests.

  • test/run-test-file.ts - Used by in VS Code configuration to launch a debug session to run a single test file.

  • test-workers/ - Contains worker definitions used by CI tests. Each worker has its own subdirectory with index.js and wrangler.jsonc files. See test-workers/README.md for details.