Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func IsTravis() bool
 - func TestMultiplier() int64
 - func WaitForLeader(t testing.TB, rpc rpcFn)
 - func WaitForResult(test testFn, error errorFn)
 - func WaitForResultRetries(retries int64, test testFn, error errorFn)
 - type Advertise
 - type ClientConfig
 - type PortsConfig
 - type ServerConfig
 - type ServerConfigCallback
 - type TestServer
 - type TestServerConfig
 - type TestVault
 - type VaultConfig
 
Constants ¶
const ( // TravisRunEnv is an environment variable that is set if being run by // Travis. TravisRunEnv = "CI" )
Variables ¶
This section is empty.
Functions ¶
func TestMultiplier ¶ added in v0.3.0
func TestMultiplier() int64
TestMultiplier returns a multiplier for retries and waits given environment the tests are being run under.
func WaitForLeader ¶
func WaitForResult ¶
func WaitForResult(test testFn, error errorFn)
func WaitForResultRetries ¶ added in v0.3.0
func WaitForResultRetries(retries int64, test testFn, error errorFn)
Types ¶
type Advertise ¶ added in v0.5.0
type Advertise struct {
	HTTP string `json:"http,omitempty"`
	RPC  string `json:"rpc,omitempty"`
	Serf string `json:"serf,omitempty"`
}
    Advertise is used to configure the addresses to advertise
type ClientConfig ¶
type ClientConfig struct {
	Enabled bool `json:"enabled"`
}
    ClientConfig is used to configure the client
type PortsConfig ¶
type PortsConfig struct {
	HTTP int `json:"http,omitempty"`
	RPC  int `json:"rpc,omitempty"`
	Serf int `json:"serf,omitempty"`
}
    PortsConfig is used to configure the network ports we use.
type ServerConfig ¶
type ServerConfig struct {
	Enabled         bool `json:"enabled"`
	BootstrapExpect int  `json:"bootstrap_expect"`
}
    ServerConfig is used to configure the nomad server.
type ServerConfigCallback ¶
type ServerConfigCallback func(c *TestServerConfig)
ServerConfigCallback is a function interface which can be passed to NewTestServerConfig to modify the server config.
type TestServer ¶
type TestServer struct {
	Config *TestServerConfig
	HTTPAddr   string
	SerfAddr   string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}
    TestServer is the main server wrapper struct.
func NewTestServer ¶
func NewTestServer(t *testing.T, cb ServerConfigCallback) *TestServer
NewTestServer creates a new TestServer, and makes a call to an optional callback function to modify the configuration.
func (*TestServer) Stop ¶
func (s *TestServer) Stop()
Stop stops the test Nomad server, and removes the Nomad data directory once we are done.
type TestServerConfig ¶
type TestServerConfig struct {
	NodeName          string        `json:"name,omitempty"`
	DataDir           string        `json:"data_dir,omitempty"`
	Region            string        `json:"region,omitempty"`
	DisableCheckpoint bool          `json:"disable_update_check"`
	LogLevel          string        `json:"log_level,omitempty"`
	AdvertiseAddrs    *Advertise    `json:"advertise,omitempty"`
	Ports             *PortsConfig  `json:"ports,omitempty"`
	Server            *ServerConfig `json:"server,omitempty"`
	Client            *ClientConfig `json:"client,omitempty"`
	Vault             *VaultConfig  `json:"vault,omitempty"`
	DevMode           bool          `json:"-"`
	Stdout, Stderr    io.Writer     `json:"-"`
}
    TestServerConfig is the main server configuration struct.
type TestVault ¶ added in v0.5.0
type TestVault struct {
	Addr      string
	HTTPAddr  string
	RootToken string
	Config    *config.VaultConfig
	Client    *vapi.Client
	// contains filtered or unexported fields
}
    TestVault wraps a test Vault server launched in dev mode, suitable for testing.
func NewTestVault ¶ added in v0.5.0
NewTestVault returns a new TestVault instance that has yet to be started
type VaultConfig ¶ added in v0.5.0
type VaultConfig struct {
	Enabled bool `json:"enabled"`
}
    VaultConfig is used to configure Vault