GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — snapmap-web/tests/README.md at main · doom-snapmap/snapmap-web

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
31 lines (23 loc) · 3.46 KB
/

README.md

Copy path

File metadata and controls

31 lines (23 loc) · 3.46 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Worker tests

Purpose

Checks the API Worker's request-body bounds, write quotas and local runtime behavior without touching GitHub or deployed storage.

Contents

  • worker_body_test.js covers streamed body limits, JSON validation, CORS on refusals, upload overflow and quota refusals.
  • worker_quota_test.js covers the SQLite quota store's atomic admission and rollback.
  • worker_mods_test.js covers every /mods/* route against in-memory R2 and SQLite-backed Durable Object doubles: a unit begun, its files sent in archives and in parts, status, the manifest, blob and archive reads with ranges (an archive read in a few long ranges), the manifest and archive checks and their one-sentence refusals, signed claims with revs and releases, the 24-hour deletion delay and the purge, pack slack and the compaction's switch, a remix's second claim, moderation (block, unblock, release-ref), the first-come account name and forget-key, asked paths, per-key and per-address limits, repair of a missing pack, the retired routes (410), refusal of incompatible schemas, and protection against bulk reset.
  • worker_contract_test.js runs, under Miniflare, every exchange the product's map-content client makes, in the shape contract/client.json records from the product's source and from a run of its own client (tests/unit_roundtrip.c there), signed as the product signs, and checks each answer against what the client accepts.
  • worker_runtime_test.js runs the Worker under Miniflare with local KV, R2 and Durable Objects, checking concurrent per-account quotas, persistence across restarts, preservation of all five legacy bundle tables and established sessions and media across a registry cutover, and a unit's upload (an archive and a file in parts), reads and claims across a restart.
  • worker_purge_test.js runs, under Miniflare with a short local MODS_DELETE_DELAY_MS, a map published, unpublished and purged through the scheduled handler, and checks the store's stats and its bucket are empty afterwards; that a file another unit still names survives the purge of one, its pack compacted to the live blobs (no slack left, the live unit's archive byte-identical whole and across a ranged download, the old object deleted a delay later); that a unit claimed again within its delay is kept; and that without the variable the purge keeps 24 hours.
  • worker_rows_test.js measures, under Miniflare, the rows the mod store's Durable Objects write (as the platform counts them, api/sql_meter.js) for a map publish of one unit of N files and a player's download of it in one request, against the file-by-file download it replaced. It is a measurement, not run by CI: node tests/worker_rows_test.js build/worker-tests/node_modules/miniflare [files] [worker root].

Working here

From the repository root, with Node 22.13 or newer:

node tests/worker_body_test.js
node tests/worker_quota_test.js
node tests/worker_mods_test.js
npm install --prefix build/worker-tests --no-audit --no-fund --no-package-lock [email protected]
node tests/worker_runtime_test.js build/worker-tests/node_modules/miniflare
node tests/worker_contract_test.js build/worker-tests/node_modules/miniflare
node tests/worker_purge_test.js build/worker-tests/node_modules/miniflare

CI runs all six. When the product's client changes, record its exchanges again (contract/README.md) and update contract/client.json with the Worker change that follows it. Preserve fixture data unless intentionally changing the case it represents.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.