GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — test(cache): give each remote cache e2e case a long-lived backend by wan9chi · Pull Request #807 · voidzero-dev/vite-task Conversation
|
fspy benchmarklinuxmacoswindows |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
85d72ea to
42c30dc
Compare
The `remote_cache_backend` fixture tested the Node test backend's own protocol through `cbor-http`, including state shared across wrapper invocations. The next change gives each e2e case one long-lived backend, and the backend is later replaced by the public cache service, which has its own protocol tests. The `remote_cache` cases keep exercising the backend through `vp run`. Remove the fixture, `cbor-http`, its EDN formatting and unit test, the `cbor-edn` catalog entry, and the CI steps that ran that test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`remote-cache-server COMMAND` started a backend for one command, so a case with several steps started several backends that shared state through files, each on a new port. Each case now starts one backend in its first step and stops it in its last: - `remote-cache-server start` runs the backend in the background, in its own session and without the terminal, so the step can finish and Ctrl-C in later steps doesn't reach it. It writes the endpoint to `remote-cache/server.json`. - `remote-cache-server run COMMAND` runs the command against that endpoint and then prints the request lines it caused. - `remote-cache-server stop` stops the backend and fails if the backend answered with a 5xx status. A backend whose case directory is gone, or that has been idle for ten minutes, also stops. The endpoint is now a tap that forwards requests and responses unchanged and records the request lines, so the backend behind it no longer logs. Apart from the added steps and the `run` in each command line, the snapshots are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
42c30dc to
ae3e746
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae3e746. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ackend (#808) ## Motivation Cases referred to blobs through the file backend's storage. Its blob IDs were sequential, and `corrupt_archive` overwrote `remote-cache/blobs/1` directly. [Vite+'s Cloudflare remote cache](https://github.com/voidzero-dev/vite-plus-remote-cache-cloudflare) stores blobs in R2 under random IDs, so those cases couldn't run against it. ## Changes - The tap numbers blobs in upload order in the request lines, e.g. `GET /blob/1 200`. - `remote-cache-server corrupt-blob NUMBER` overwrites a stored blob through the backend. `corrupt_archive` uses it. - The file backend uses random UUIDs as blob IDs, as the Worker does, so the numbering is already exercised here. The only snapshot change is `corrupt_archive`'s command line. Stacked on #807. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to Node test/daemon tooling and snapshot fixtures, not production vt cache client behavior. > > **Overview** > Remote cache test tooling now matches production-style **random UUID blob IDs** instead of sequential numeric files, while keeping E2E snapshot logs stable by **numbering blobs by upload order** in tap output (e.g. `GET /blob/1`). > > A new **`remote-cache-server corrupt-blob NUMBER`** command overwrites the nth stored blob through the backend control API; the `corrupt_archive` snapshot switches from direct `vtt write-file` on `remote-cache/blobs/1` to this command. Docs and `state.json` drop `next_blob_id`; the backend exposes `writeBlob` for corruption from the daemon. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1a7799e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 5.5 <[email protected]>
…rker (#811) ## Motivation The remote cache e2e cases ran against a Node file backend that imitated a remote cache server's protocol and write policy. #807 → #810 put the test infrastructure in place against that backend: one backend per case, a tap for the request log, blob numbering, `corrupt-blob`, and a GitHub Actions stand-in. Vite+'s Cloudflare implementation now lives in [voidzero-dev/vite-plus-remote-cache-cloudflare](https://github.com/voidzero-dev/vite-plus-remote-cache-cloudflare), moved there from #718, and the cases can run against it: a real, independently written server for the protocol. ## Changes - **Backend.** Behind the same `remote-cache-server` commands, the backend is that Worker at a pinned commit, a git dependency of `vite-task-tools`, running in workerd through Miniflare: - The Worker runs with the compatibility settings, bindings, and limits that wrangler reads from its `wrangler.jsonc`. Its namespaces are limited to the endpoint's. - As in a deployment, every migration is applied with wrangler's SQL splitter, and the namespace is registered for the endpoint and the test repository. - The Worker fetches GitHub's key set to verify upload tokens and gets the stand-in's key instead. Any other outbound request fails. - `corrupt-blob` replaces the blob's object in R2 and its recorded size. - **Workspace.** The workspace allows esbuild's and workerd's build scripts, which a root `pnpm install` otherwise rejects. `@cloudflare/workers-types` provides Miniflare's binding types. - **Removed** the file backend and its `@fastify/busboy` dependency. - **musl.** The cases that use the backend are skipped on musl, because workerd's prebuilt binaries require glibc. - **Restarts.** `start` empties the Worker's D1 database and R2 bucket in `remote-cache/state/` first, since the migrations assume a new database. - **Tap.** The Worker rejects an upload by its headers, answering before it reads the body, and then closes the connection. The tap no longer counts the failure to send the rest of that body as a backend problem once the whole response has arrived. With a large rejected upload, `stop` failed every time before this change. **None of the snapshots change.** Apart from that tap fix, the daemon, the tap, the CLI, and the stand-in are untouched. Only the backend behind them is different. Stacked on #810. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Test-infra swap with heavier Node deps and platform limits (no musl); behavior now depends on an external Worker package and Miniflare, though production client code is unchanged. > > **Overview** > Replaces the in-repo **Node file backend** (`state.json` + blob files) with **Vite+'s pinned Cloudflare remote cache Worker**, started locally via **Miniflare/workerd**. `startBackend` bundles the Worker with esbuild, applies D1 migrations, registers the test namespace, mocks GitHub JWKS for upload tokens, and persists state under `remote-cache/state/` (cleared on each `start`). **`corrupt-blob`** now writes corrupt bytes into **R2** and updates the recorded blob size. > > **Dependencies:** adds `miniflare`, `wrangler`, `esbuild`, and the git-pinned Worker package; removes `@fastify/busboy`. Workspace **`allowBuilds`** enables **workerd** install scripts. > > **E2E:** every snapshot case that starts `remote-cache-server` gets `cfg = 'not(target_env = "musl")'` because workerd needs glibc. README documents the new backend. > > **Tap fix:** when the Worker rejects an upload from headers and closes the connection before the body is sent, the proxy no longer treats the resulting write error as a backend failure once the response is complete—so `stop` stays reliable on large rejected uploads. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7ddfbd5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.