Repository navigation
The v2 emulator is a ground-up overhaul
Breaking changes
- The Go module path is now
github.com/aertje/cloud-tasks-emulator/v2. The v1 root package is gone; embedding is done through the newemulatorpackage and everything else lives underinternal. - The
-queuestartup flag is renamed to-initial-queue. - Requests that production Cloud Tasks rejects are now rejected by the emulator too. Code that relied on the v1 emulator being lenient (invalid names, out-of-range queue settings, oversized tasks, malformed target URLs) will now get the same errors it would get in production.
Embed the emulator in Go tests
Import github.com/aertje/cloud-tasks-emulator/v2/emulator to run the emulator in-process, no Docker required. Options cover initial queues, OIDC issuer and signing key, and App Engine routing. See EXAMPLES.md.
Configuration
- Every flag can equivalently be set via an environment variable, no wrapper script needed. See the configuration table.
- New options: a user-supplied OIDC signing key (
-openid-signing-key), skipping TLS verification for self-signed HTTPS targets (-insecure-skip-tls-verify), and App Engine routing (-app-engine-emulator-hostto point tasks at a local server,-app-engine-region-idfor the regionalr.appspot.comhost format).
Validated against real Cloud Tasks
- A new conformance harness runs the same scenarios against production Cloud Tasks and records the responses as goldens; the emulator is tested against those goldens.
- Validation at
CreateQueueandCreateTaskmirrors production: queue and task names, rate limits, retry configuration, dispatch deadlines, schedule horizons, HTTP target URLs and the task size limit, with matching error codes, messages and details. - Dispatch fidelity: production request headers (including the optional retry headers),
BASIC/FULLresponse views, retry backoff anchored the way production anchors it, and tombstoning so deleted queue and task names behave as they do in production.