Documentation
¶
Index ¶
- Variables
- func DeleteTestrun(tmClient client.Client, tr *tmv1beta1.Testrun)
- func DisruptiveTestDef(name string) *testdefinition.TestDefinition
- func DumpState(ctx context.Context, log logr.Logger, client client.Client, ...)
- func GetWorkflow(ctx context.Context, tmClient client.Client, tr *tmv1beta1.Testrun) (*argov1.Workflow, error)
- func HTTPGet(url string) (*http.Response, error)
- func ReadJSONFile(path string, obj interface{}) error
- func ReadYAMLFile(path string, obj interface{}) error
- func RunTestrun(ctx context.Context, log logr.Logger, tmClient client.Client, ...) (*tmv1beta1.Testrun, *argov1.Workflow, error)
- func RunTestrunUntilCompleted(ctx context.Context, log logr.Logger, tmClient client.Client, ...) (*tmv1beta1.Testrun, *argov1.Workflow, error)
- func SerialTestDef(name string) *testdefinition.TestDefinition
- func TestDef(name string) *testdefinition.TestDefinition
- func TestDefWithConfig(td *testdefinition.TestDefinition, cfgs []tmv1beta1.ConfigElement) *testdefinition.TestDefinition
- func WaitForClusterReadiness(log logr.Logger, clusterClient client.Client, namespace string, ...) error
- func WatchTestrun(ctx context.Context, tmClient client.Client, tr *tmv1beta1.Testrun, ...) error
- func WatchTestrunUntilCompleted(ctx context.Context, tmClient client.Client, tr *tmv1beta1.Testrun, ...) (*tmv1beta1.Testrun, error)
- func WatchUntilCompletedFunc(tr *tmv1beta1.Testrun) (bool, error)
- type LocationsMock
- type TDLocationMock
- func (l *TDLocationMock) GetLocation() *tmv1beta1.TestLocation
- func (l *TDLocationMock) GitInfo() testdefinition.GitInfo
- func (l *TDLocationMock) Name() string
- func (l *TDLocationMock) SetTestDefs(_ map[string]*testdefinition.TestDefinition) error
- func (l *TDLocationMock) Type() tmv1beta1.LocationType
- type WatchFunc
Constants ¶
This section is empty.
Variables ¶
var EmptyMockLocation = &LocationsMock{ GetTestDefinitionsFunc: func(step tmv1beta1.StepDefinition) ([]*testdefinition.TestDefinition, error) { return []*testdefinition.TestDefinition{}, nil }, }
Functions ¶
func DeleteTestrun ¶
DeleteTestrun deletes a testrun and expects to be successful.
func DisruptiveTestDef ¶
func DisruptiveTestDef(name string) *testdefinition.TestDefinition
DisruptiveTestDef creates a new disruptive testdefinition with a name
func DumpState ¶
func DumpState(ctx context.Context, log logr.Logger, client client.Client, tr, foundTestrun *tmv1beta1.Testrun)
DumpState dumps the current testrun und workflow state
func GetWorkflow ¶
func GetWorkflow(ctx context.Context, tmClient client.Client, tr *tmv1beta1.Testrun) (*argov1.Workflow, error)
GetWorkflow returns the argo workflow of a testrun.
func ReadJSONFile ¶
ReadJSONFile reads a file and deserializes the json into the given object
func ReadYAMLFile ¶
ReadYAMLFile reads a file and deserializes the yaml into the given object
func RunTestrun ¶
func RunTestrun(ctx context.Context, log logr.Logger, tmClient client.Client, tr *tmv1beta1.Testrun, phase argov1.WorkflowPhase, timeout time.Duration, f WatchFunc) (*tmv1beta1.Testrun, *argov1.Workflow, error)
RunTestrunUntilCompleted executes a testrun on a cluster until a specific state has been reached and returns the corresponding executed testrun and workflow. Note: Deletion of the workflow on error should be handled by the calling test.
func RunTestrunUntilCompleted ¶
func RunTestrunUntilCompleted(ctx context.Context, log logr.Logger, tmClient client.Client, tr *tmv1beta1.Testrun, phase argov1.WorkflowPhase, timeout time.Duration) (*tmv1beta1.Testrun, *argov1.Workflow, error)
RunTestrunUntilCompleted executes a testrun on a cluster until it is finished and returns the corresponding executed testrun and workflow. Note: Deletion of the workflow on error should be handled by the calling test. DEPRECATED: this is just a wrapper function to keep functionality across tests. In the future the RunTestrun function should be directly used.
func SerialTestDef ¶
func SerialTestDef(name string) *testdefinition.TestDefinition
SerialTestDef creates a new serial testdefinition with a name
func TestDef ¶
func TestDef(name string) *testdefinition.TestDefinition
TestDef creates a new empty testdefinition with a step name
func TestDefWithConfig ¶
func TestDefWithConfig(td *testdefinition.TestDefinition, cfgs []tmv1beta1.ConfigElement) *testdefinition.TestDefinition
TestDefWithConfig adds a config to the given testdefinition and returns it
func WaitForClusterReadiness ¶
func WaitForClusterReadiness(log logr.Logger, clusterClient client.Client, namespace string, maxWaitTime time.Duration) error
WaitForClusterReadiness waits for all testmachinery components to be ready.
func WatchTestrun ¶
func WatchTestrun(ctx context.Context, tmClient client.Client, tr *tmv1beta1.Testrun, timeout time.Duration, f WatchFunc) error
WatchTestrun watches a testrun until the maxwait is reached. Every time a testrun can be found without a problem the function f is called.
Types ¶
type LocationsMock ¶
type LocationsMock struct { TestDefinitions []*testdefinition.TestDefinition StepToTestDefinitions map[string][]*testdefinition.TestDefinition GetTestDefinitionsFunc func(step tmv1beta1.StepDefinition) ([]*testdefinition.TestDefinition, error) }
func (*LocationsMock) GetTestDefinitions ¶
func (t *LocationsMock) GetTestDefinitions(step tmv1beta1.StepDefinition) ([]*testdefinition.TestDefinition, error)
type TDLocationMock ¶
type TDLocationMock struct{}
func (*TDLocationMock) GetLocation ¶
func (l *TDLocationMock) GetLocation() *tmv1beta1.TestLocation
func (*TDLocationMock) GitInfo ¶
func (l *TDLocationMock) GitInfo() testdefinition.GitInfo
func (*TDLocationMock) Name ¶
func (l *TDLocationMock) Name() string
func (*TDLocationMock) SetTestDefs ¶
func (l *TDLocationMock) SetTestDefs(_ map[string]*testdefinition.TestDefinition) error
func (*TDLocationMock) Type ¶
func (l *TDLocationMock) Type() tmv1beta1.LocationType