etcdtest

package
v0.88.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

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

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 added in v0.86.1

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL