{"by":"jy-tan","descendants":8,"id":46637322,"kids":[46660695,46645129,46664354,46667590],"score":33,"text":"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&#x2F;O (databases, HTTP calls, etc.) gets automatically mocked using the recorded data.<p>Problem we&#x27;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.<p>versus mocking libraries: Tools like VCR&#x2F;Nock intercept HTTP within your tests. Tusk Drift records full request&#x2F;response traces externally (HTTP, DB, Redis, etc.) and replays them against your running service, no test code or fixtures to write&#x2F;maintain.<p>How it works:<p>1. Add a lightweight SDK (we currently support Python and Node.js)<p>2. Record traffic in any environment.<p>3. Run `tusk run`, the CLI sandboxes your service and serves mocks via Unix socket<p>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.<p>Source: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Use-Tusk&#x2F;tusk-drift-cli\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;Use-Tusk&#x2F;tusk-drift-cli</a><p>Demo: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Use-Tusk&#x2F;drift-node-demo\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;Use-Tusk&#x2F;drift-node-demo</a><p>Happy to answer questions!","time":1768503250,"title":"Show HN: Tusk Drift – Turn production traffic into API tests","type":"story","url":"https://github.com/Use-Tusk/tusk-drift-cli"}