Documentation ¶
Index ¶
- Variables
- func AddToWorkspace(path string, tunnels []config.Tunnel) error
- func TestWithRetry(ctx context.Context, trigger chan struct{}, test func() bool) bool
- type ReadResult
- type StreamReader
- type TestHelper
- func (helper *TestHelper) Dev(ctx context.Context, args ...string) (chan error, error)
- func (helper *TestHelper) Exec(service string, command []string) (string, error)
- func (helper *TestHelper) MicroserviceTrigger() (chan struct{}, error)
- func (helper *TestHelper) Run(ctx context.Context, command ...string) ([]byte, error)
- func (helper *TestHelper) Start(ctx context.Context, args ...string) (io.Reader, chan error, error)
- func (helper *TestHelper) TunnelTrigger() (chan struct{}, error)
- func (helper *TestHelper) WaitUntilReady(ctx context.Context) error
- func (helper *TestHelper) WaitUntilSynced(ctx context.Context, servicePath string) error
- func (helper *TestHelper) WatchForErrors(ctx context.Context, t *testing.T)
Constants ¶
This section is empty.
Variables ¶
var ErrNeverSynced = errors.New("never synced")
Functions ¶
Types ¶
type ReadResult ¶
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader provides convenience methods for reading from io streams.
func NewStreamReader ¶
func NewStreamReader(stream io.Reader) StreamReader
NewStreamReader returns a new StreamReader
func (StreamReader) Read ¶
func (sr StreamReader) Read(ctx context.Context) chan ReadResult
Read reads from the stream and sends the result on the channel.
func (StreamReader) ReadUntilTimeout ¶
ReadUntilTimeout reads from the stream until nothing new has been written in `timeout`.
type TestHelper ¶
type TestHelper struct { KubeClient kubernetes.Interface KeldaClient keldaClientset.Interface User config.User ExamplesRepoPath string CIRootPath string // contains filtered or unexported fields }
TestHelper contains methods commonly used during integration tests.
func NewTestHelper ¶
func NewTestHelper(examplesRepoPath, ciRootPath string) (*TestHelper, error)
NewTestHelper creates a new TestHelper.
func (*TestHelper) Dev ¶
Dev runs `kelda dev` with the given arguments, and waits until the development environment is ready for use.
func (*TestHelper) Exec ¶
func (helper *TestHelper) Exec(service string, command []string) (string, error)
func (*TestHelper) MicroserviceTrigger ¶
func (helper *TestHelper) MicroserviceTrigger() (chan struct{}, error)
MicroserviceTrigger returns a channel that triggers each time there's a change in the Microservice CRDs.
func (*TestHelper) Start ¶
func (helper *TestHelper) Start(ctx context.Context, args ...string) ( io.Reader, chan error, error)
Start starts the given Kelda command. It returns a thread-safe reader for the stdout output, and a channel for obtaining any errors after starting the command, and any errors from starting the command.
func (*TestHelper) TunnelTrigger ¶
func (helper *TestHelper) TunnelTrigger() (chan struct{}, error)
TunnelTrigger returns a channel that triggers each time there's a change in the Tunnel CRDs.
func (*TestHelper) WaitUntilReady ¶
func (helper *TestHelper) WaitUntilReady(ctx context.Context) error
WaitUntilReady blocks until all the Tunnels and Microservices in the Workspace are ready.
func (*TestHelper) WaitUntilSynced ¶
func (helper *TestHelper) WaitUntilSynced(ctx context.Context, servicePath string) error
WaitUntilSynced blocks until the local files in `servicePath` are running in the development environment.
func (*TestHelper) WatchForErrors ¶
func (helper *TestHelper) WatchForErrors(ctx context.Context, t *testing.T)
WatchForErrors watches for any errors in development environment.