# Tusk Drift – Turn production traffic into API tests

Hi HN! In the past few months my team and I have been working on Tusk Drift, a system that records real API traffic from your service, then replays those requests as deterministic tests. Outbound I/O (databases, HTTP calls, etc.) gets automatically mocked using the recorded data. Problem we're tryi…

- **Page:** https://magpie.gallery/i/tusk-drift-turn-production-traffic-into-api-tests-gpy5
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** api, testing, mocking, traffic, replay

## Source

Web · jy-tan: Tusk Drift – Turn production traffic into API tests

- **Original:** https://news.ycombinator.com/item?id=46637322

> Hi HN! In the past few months my team and I have been working on Tusk Drift, a system that records real API traffic from your service, then replays those requests as deterministic tests. Outbound I/O (databases, HTTP calls, etc.) gets automatically mocked using the recorded data. Problem we're trying to solve: Writing API tests is tedious, and hand-written mocks drift from reality. We wanted tests that stay realistic because they come from real traffic. versus mocking libraries: Tools like VCR/Nock intercept HTTP within your tests. Tusk Drift records full request/response traces externally (HTTP, DB, Redis, etc.) and replays them against your running service, no test code or fixtures to write/maintain. How it works: 1. Add a lightweight SDK (we currently support Python and Node.js) 2. Record traffic in any environment. 3. Run `tusk run`, the CLI sandboxes your service and serves mocks via Unix socket We run this in CI on every PR. Also been using it as a test harness for AI coding agents, they can make changes, run `tusk run`, and get immediate feedback without needing live dependencies. Source: https://github.com/Use-Tusk/tusk-drift-cli Demo: https://github.com/Use-Tusk/drift-node-demo Happy to answer questions! https://github.com/Use-Tusk/tusk-drift-cli

## GitHub projects

- https://github.com/Use-Tusk/drift-node-demo
- https://github.com/Use-Tusk/tusk-drift-cli

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
