Reliving Your Happiest HTTP Interactions with Ruby’s VCR Gem
VCR records live HTTP interactions into YAML "cassettes" and replays them in Ruby tests, giving accurate fixtures for complex, slow, or poorly understood APIs where hand-built Webmock stubs drift from real behavior. Use VCR for multi-call integration tests and unpredictable APIs, and keep Webmock or decomposed unit tests for simple, well-understood calls or state that is hard to reproduce. Practical advice includes avoiding the default :new_episodes record mode in favor of :once or :none, logging requests with before filters, scrubbing secrets with filter_sensitive_data, isolating erratic auth calls into their own cassettes, and deleting cassettes liberally.
Related posts
- Deterministic AI Testing with Session Recording in cagent
Docker mediumAdeptcagent's session recording applies the VCR pattern to AI agents. It proxies requests to the model provider, saves each request/response cycle to a YAML cassette, and replays matching requests from that file, so test runs are deterministic, cost nothing in API calls and finish in milliseconds. The --record and --fake flags support CI testing without API keys, cheap prompt iteration against one recording, sharing reproducible bug reports, and capturing multi-agent delegation. Tool call IDs are normalized so replay matching works, and auth headers are stripped so cassettes can be committed to version control.
- Enhancing the Mock Server: A User Interface Approach
Zalando Engineering mediumAdeptZalando's team built a UI on top of mirage.js so product managers and designers can switch which mocked response each API endpoint returns on a staging build, without code changes or redeploys. A React Context provider re-instantiates the mock server on demand, and the selected scenario is kept in session storage under an app-unique key so it survives the page reload that loading a new data set requires. The approach covers edge cases like stale or missing data, but it complements rather than replaces unit and contract tests, and the frontend-defined mocks must be kept in sync with the backend schema. A generalized version now ships as an internal NPM module.
- Modular regression testing framework built on AWS for large-scale systems
AWS Architecture Blog mediumAdeptA traffic-replay regression testing framework built on AWS captures production requests and responses, replays a sample against new code in pre-production, and gates deployments on a CloudWatch alarm over the fraction of matching outputs (typically 99.9%). Step Functions toggles a Lambda event source mapping on a DynamoDB stream, replayed requests carry simulation IDs so stateful services can skip side effects and seed randomness deterministically, and responses are reduced and normalized before comparison via CloudWatch Logs Insights. Over six months it caught five customer-impacting regressions with zero false positives, using about 5% traffic replay with 200-record batches and reserved concurrency to cap load.
- Introducing eve 1.0
Vercel easyNoviceeve 1.0, Vercel's open-source framework for production agents, is now generally available with a customizable harness (model, tools, subagents, approvals), durable execution via the Workflow SDK, multiplayer sessions across Slack and other channels, multi-tenant credentials and policies, cross-session memory, and OpenTelemetry-based tracing with per-destination redaction. Median hosted turn overhead fell from 3.036s to 414ms (p95 3.692s to 633ms) after Workflow spec 9 gave each run a single orchestrator, moved event writes to WebSockets and cut redundant history reads. Storing only changed conversation data between turns, referencing images instead of copying bytes, and reusing sandbox snapshots cut estimated Workflows cost for a 50-turn session by about 76%.
- Workflow SDK 5: built for production
Vercel mediumAdeptWorkflow SDK 5 reworks Vercel's durable async JavaScript workflow engine around security, regional placement and performance. Step payloads are now encrypted end to end with AES-256-GCM using per-run keys. On self-hosted Worlds, encryption works through a getEncryptionKeyForRun() hook. Runs are pinned to a home region chosen at start(). The engine executes multiple steps inline instead of taking a queue hop per step, replays incrementally, and streams over WebSockets. Benchmarks against v4 show p75 step-to-step overhead dropping from 618 ms to 109 ms, late-run overhead in a 1,020-step workflow falling from 1,748 ms to 70 ms, and stream delivery time improving 4.2×.