baseplate.go icon indicating copy to clipboard operation
baseplate.go copied to clipboard

Add redisxtest

Open zack-keim opened this issue 2 years ago • 0 comments

Summary

Adds redisxtest implementation which provides setup and teardown functions for setting up a mock redis cluster and client for testing purposes. One of the challenges of using this package is that testing clients requires writing setup and teardown functions for the mock redis instance. This leads to a lot of copy and paste across baseplate.go services, since the pattern is nearly identical. This change makes it possible to set up a mock redis cluster and client of that cluster with two simple functions.

What to look out for

Current implementation uses miniredis to mock the redis instance. miniredis is the currently the predominately used library for standing up a local in-memory redis instance for testing purposes in go. However, there may be other options out there.

zack-keim avatar Feb 28 '22 23:02 zack-keim