Documentation
¶
Index ¶
- func DefaultConfig(scope CleanupScope) *config.Config
- func HelloWorld() *tes.Task
- func LogConfig() *logconfig.LoggerConfig
- func ParseConfig()
- func RandomPortConfig(conf *config.Config) *config.Config
- func RandomString(n int) string
- func RunSuite(m *testing.M, setup func(CleanupScope) bool) int
- func SetLogOutput(l *logger.Logger, t *testing.T)
- func TempDirConfig(scope CleanupScope, conf *config.Config) *config.Config
- func TestifyConfig(scope CleanupScope, conf *config.Config) *config.Config
- func TestingWriter(t *testing.T) io.Writer
- type CleanupScope
- type Funnel
- func (f *Funnel) Cancel(id string) error
- func (f *Funnel) Cleanup()
- func (f *Funnel) CleanupTestServerContainer(containerName string)
- func (f *Funnel) Get(id string) *tes.Task
- func (f *Funnel) GetView(id string, view tes.View) *tes.Task
- func (f *Funnel) PollForServerStart() error
- func (f *Funnel) ReadFile(name string) string
- func (f *Funnel) Run(s string) string
- func (f *Funnel) RunE(s string) (string, error)
- func (f *Funnel) RunTask(t *tes.Task) (string, error)
- func (f *Funnel) StartServer()
- func (f *Funnel) StartServerInDocker(containerName, imageName string, extraArgs []string)
- func (f *Funnel) SwitchUser(username string)
- func (f *Funnel) Tempdir() string
- func (f *Funnel) Wait(id string) *tes.Task
- func (f *Funnel) WaitForDockerDestroy(id string)
- func (f *Funnel) WaitForExec(id string, i int)
- func (f *Funnel) WaitForInitializing(ids ...string)
- func (f *Funnel) WaitForRunning(ids ...string)
- func (f *Funnel) WriteFile(name string, content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
func DefaultConfig(scope CleanupScope) *config.Config
DefaultConfig returns a default configuration useful for testing, including temp storage dirs, random ports, S3 + minio config, etc.
func HelloWorld ¶
HelloWorld is a simple, valid task that is easy to reuse in tests.
func LogConfig ¶
func LogConfig() *logconfig.LoggerConfig
LogConfig returns logger configuration useful for tests, which has a text indent.
func ParseConfig ¶
func ParseConfig()
func RandomPortConfig ¶
RandomPortConfig returns a modified config with random HTTP and RPC ports.
func RandomString ¶
RandomString generates a random string of length n
func RunSuite ¶
func RunSuite(m *testing.M, setup func(CleanupScope) bool) int
RunSuite releases suite resources on normal exit, skipped setup, and setup panic. Setup returns false when the configured integration backend is unavailable.
func SetLogOutput ¶
SetLogOutput provides a method for connecting funnel logso the the test logger
func TempDirConfig ¶
func TempDirConfig(scope CleanupScope, conf *config.Config) *config.Config
TempDirConfig returns a modified config with workdir and db path set to a temp. directory.
func TestifyConfig ¶
func TestifyConfig(scope CleanupScope, conf *config.Config) *config.Config
TestifyConfig modifies a ports, directory paths, etc. to avoid conflicts between tests.
Types ¶
type CleanupScope ¶
CleanupScope owns integration-test resources for a test or an entire suite.
type Funnel ¶
type Funnel struct {
// Clients
RPC tesrpc.TaskServiceClient
HTTP *tesclient.Client
Docker *docker.Client
Kubernetes *kubernetes.Clientset
// Config
Conf *config.Config
StorageDir string
// Components
Server *server.Server
Scheduler *scheduler.Scheduler
Srv *servercmd.Server
// contains filtered or unexported fields
}
Funnel provides a test server and RPC/HTTP clients
func NewFunnel ¶
func NewFunnel(scope CleanupScope, conf *config.Config) *Funnel
NewFunnel creates a new funnel test server with some test configuration automatically set: random ports, temp work dir, etc.
func (*Funnel) CleanupTestServerContainer ¶
CleanupTestServerContainer stops the docker container running the test funnel server
func (*Funnel) PollForServerStart ¶
PollForServerStart polls the server http address to check if the server is running.
func (*Funnel) StartServerInDocker ¶
StartServerInDocker starts a funnel server in a docker image
func (*Funnel) SwitchUser ¶
Changes the user who will be making the RPC calls. Panics if that user is not defined in the configuration.
func (*Funnel) WaitForDockerDestroy ¶
WaitForDockerDestroy waits until Docker no longer has the container.
func (*Funnel) WaitForExec ¶
WaitForExec waits for a task to reach the given executor index. 1 is the first executor.
func (*Funnel) WaitForInitializing ¶
WaitForInitializing waits for a task to be in the Initializing state
func (*Funnel) WaitForRunning ¶
WaitForRunning waits for a task to be in the RUNNING state