Documentation
¶
Index ¶
- Constants
- func ExecWithCmd(cmd string) gomock.Matcher
- func ExecWithRef(ref executable.Ref) gomock.Matcher
- func FindSubExecs(rootExec *executable.Executable, flowFiles executable.FlowFileList) executable.ExecutableList
- func MaybeUpdateGolden(tb testing.TB, out []byte)
- func NormalizeTmpDirs(input string) string
- func RequireEqualSnapshot(tb testing.TB, out []byte)
- func ResetTestContext(ctx *Context, t ginkgo.FullGinkgoTInterface)
- func UpdateGolden(tb testing.TB, out []byte)
- type CommandRunner
- type Context
- type ContextWithMocks
Constants ¶
View Source
const ( TestWorkspaceName = "default" TestWorkspaceDisplayName = "Default Workspace" )
Variables ¶
This section is empty.
Functions ¶
func ExecWithCmd ¶
func ExecWithRef ¶
func ExecWithRef(ref executable.Ref) gomock.Matcher
func FindSubExecs ¶
func FindSubExecs(rootExec *executable.Executable, flowFiles executable.FlowFileList) executable.ExecutableList
FindSubExecs returns a list of sub-executables for the given root executable.
func MaybeUpdateGolden ¶ added in v1.0.1
func NormalizeTmpDirs ¶ added in v1.0.1
NormalizeTmpDirs replaces all file paths under the system temp dir with /TMPDIR.
func RequireEqualSnapshot ¶ added in v1.0.1
func ResetTestContext ¶
func ResetTestContext(ctx *Context, t ginkgo.FullGinkgoTInterface)
func UpdateGolden ¶ added in v1.0.1
Types ¶
type CommandRunner ¶
type CommandRunner struct{}
func NewE2ECommandRunner ¶
func NewE2ECommandRunner() *CommandRunner
type Context ¶
func NewContext ¶
NewContext creates a new context for testing runners. It initializes the context with a real logger that writes it's output to a temporary file. It also creates a temporary testing directory for the test workspace, user configs, and caches. Test environment variables are set the config and cache directories override paths.
func (*Context) WorkspaceDir ¶ added in v1.0.1
type ContextWithMocks ¶
type ContextWithMocks struct {
Ctx *context.Context
Logger *tuikitIOMocks.MockLogger
ExecutableCache *cacheMocks.MockExecutableCache
WorkspaceCache *cacheMocks.MockWorkspaceCache
RunnerMock *mocks.MockRunner
}
func NewContextWithMocks ¶
func NewContextWithMocks(ctx stdCtx.Context, t ginkgo.FullGinkgoTInterface) *ContextWithMocks
NewContextWithMocks creates a new context for testing runners. It initializes the context with a mock logger and mock caches. The mock logger is set to expect debug calls.
Click to show internal directories.
Click to hide internal directories.