...
TestServer and TestCluster are two frameworks we built to create Go unit tests for CockroachDB:
TestServer simulates a single CockroachDB node.
TestCluster simulates a multi-node CockroachDB cluster. Each node is simulated using one TestServer.
By default, TestServer uses in-RAM storage (not persisted) to make tests faster.
For integration tests, consider using roachtest instead. See: the page Roachtest vs TestServer for details.
Here are the main differences between a regular CockroachDB node (e.g. one started via cockroach start
) and one simulated via TestServer:
...
In a later version, we envision to redirect the implicit ApplicationLayerInterface
to the result of .ApplicationLayer()
automatically, so that this entire section becomes a non-problem. Follow along here: https://github.com/cockroachdb/cockroach/pull/110001