core: go.gazette.dev/core/etcdtest Index | Files

package etcdtest

import "go.gazette.dev/core/etcdtest"

Package etcdtest provides test support for obtaining a client to an Etcd server.

Index

Package Files

etcd.go

func Cleanup Uses

func Cleanup()

Cleanup is called at the completion of each test using TestClient, to remove any remaining key/value fixtures in the Etcd store.

func TestClient Uses

func TestClient() *clientv3.Client

TestClient returns a client of the embedded Etcd test server. It asserts that the Etcd keyspace is empty before returning to the client. In other words, it asserts that the prior test cleaned up after itself.

func TestMainWithEtcd Uses

func TestMainWithEtcd(m *testing.M)

TestMainWithEtcd is to be called by other packages which require functionality of the etcdtest package, before those tests run, as:

func TestMain(m *testing.M) { etcdtest.TestMainWithEtcd(m) }

This TestMain function is automatically invoked by the `go test` tool, providing an opportunity to start the embedded Etcd server prior to test invocations.

Package etcdtest imports 9 packages (graph). Updated 2020-08-25. Refresh now. Tools for package owners.