// the find
alicebob/miniredis
Pure Go Redis server for Go unittests
Miniredis is a pure Go, in-process Redis server for unit testing — the same idea as net/http/httptest but for Redis. You point your real Redis client at it over TCP, and it runs inside your test process with no external dependencies. The target audience is Go developers who want to test Redis-backed code without spinning up Docker or mocking at the client layer.
The command coverage is genuinely impressive: strings, hashes, lists, sets, sorted sets, streams, pub/sub, Lua scripting, HyperLogLog, geo commands, and transactions all work. The FastForward/SetTime API for time-dependent TTL testing is exactly right — you can test expiration logic deterministically without sleeping. Integration tests run against a real Redis 8.4.0 instance to catch behavioural drift, which is the correct way to validate a compatibility layer. RunT(t) cleans up automatically via t.Cleanup, so there's no setup/teardown boilerplate.
GEOHASH is missing despite the rest of the GEO commands being there, which will catch people off guard. The FUNCTION / FCALL commands (Redis 7+) are not implemented, so if your production code uses Redis Functions rather than EVAL Lua scripts, this doesn't help you. INFO returns almost nothing — just connected_clients — so any code that inspects server stats or config in tests will silently get wrong data. It speaks a real TCP protocol, which is good for correctness but adds a tiny bit of latency overhead compared to an in-memory mock; in tests that run tens of thousands of operations this adds up.