cockroach: Index | Files

package testingshim

import ""


Package Files


func InitTestServerFactory Uses

func InitTestServerFactory(impl TestServerFactory)

InitTestServerFactory should be called once to provide the implementation of the service. It will be called from a xx_test package that can import the server package.

type TestServerFactory Uses

type TestServerFactory interface {
    // New instantiates a test server instance.
    New(ctx TestServerParams) TestServerInterface

TestServerFactory encompasses the actual implementation of the shim service.

type TestServerInterface Uses

type TestServerInterface interface {
    Start() error

    // ServingAddr returns the server's address.
    ServingAddr() string

    // KVClient() returns a *client.DB instance for talking to this KV server,
    // as an interface{}.
    KVClient() interface{}

    // KVDB() returns the *kv.DB instance as an interface{}.
    KVDB() interface{}

    // RPCContext returns the rpc context used by the test server.
    RPCContext() *rpc.Context

    // LeaseManager() returns the *sql.LeaseManager as an interface{}.
    LeaseManager() interface{}

    // Clock returns the clock used by the TestServer.
    Clock() *hlc.Clock

TestServerInterface defines test server functionality that tests need; it is implemented by server.TestServer.

func NewTestServer Uses

func NewTestServer(params TestServerParams) TestServerInterface

NewTestServer creates a new test server with the given parameters.

type TestServerParams Uses

type TestServerParams struct {
    // Knobs for the test server.
    Knobs base.TestingKnobs

    // JoinAddr (if nonempty) is the address of a node we are joining.
    JoinAddr string

TestServerParams contains the parameters we can set when creating a test server.

Package testingshim imports 3 packages (graph). Updated 2017-07-06. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).