Documentation ¶
Index ¶
- func CreatePipelineRunFromJSON(ctx context.Context, pipelineRunJSON string) (result *api.PipelineRun, err error)
- func CreatePipelineRunFromYAML(ctx context.Context, pipelineRunYAML string) (result *api.PipelineRun, err error)
- func CreateTenant(ctx context.Context, tenant *api.Tenant) (*api.Tenant, error)
- func CreateTenantFromJSON(ctx context.Context, tenantJSON string) (result *api.Tenant, err error)
- func CreateTenantFromYAML(ctx context.Context, tenantYAML string) (result *api.Tenant, err error)
- func DeletePipelineRun(ctx context.Context, pipelineRun *api.PipelineRun) error
- func DeleteTenant(ctx context.Context, tenant *api.Tenant) error
- func ExecutePipelineRunTests(t *testing.T, testPlans ...TestPlan)
- func GetClientFactory(ctx context.Context) k8s.ClientFactory
- func GetNamespace(ctx context.Context) string
- func GetPipelineRun(ctx context.Context) *api.PipelineRun
- func GetRealmUUID(ctx context.Context) string
- func GetTenant(ctx context.Context, tenant *api.Tenant) (*api.Tenant, error)
- func GetTenantNamespace(ctx context.Context) string
- func GetTestName(ctx context.Context) string
- func GetWaitInterval(ctx context.Context) time.Duration
- func SetClientFactory(ctx context.Context, clientFactory k8s.ClientFactory) context.Context
- func SetNamespace(ctx context.Context, namespace string) context.Context
- func SetPipelineRun(ctx context.Context, PipelineRun *api.PipelineRun) context.Context
- func SetRealmUUID(ctx context.Context) context.Context
- func SetTenantNamespace(ctx context.Context, namespace string) context.Context
- func SetTestName(ctx context.Context, Name string) context.Context
- func SetWaitInterval(ctx context.Context, interval time.Duration) context.Context
- func Setup(t *testing.T) context.Context
- func WaitFor(ctx context.Context, conditionFunc WaitConditionFunc) (time.Duration, error)
- type PipelineRunCheck
- type PipelineRunTest
- type PipelineRunTestBuilder
- type TenantCheck
- type TenantTest
- type TestPlan
- type WaitConditionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePipelineRunFromJSON ¶
func CreatePipelineRunFromJSON(ctx context.Context, pipelineRunJSON string) (result *api.PipelineRun, err error)
CreatePipelineRunFromJSON creates a Tenant resource on a client
func CreatePipelineRunFromYAML ¶
func CreatePipelineRunFromYAML(ctx context.Context, pipelineRunYAML string) (result *api.PipelineRun, err error)
CreatePipelineRunFromYAML creates a Tenant resource on a client
func CreateTenant ¶
CreateTenant creates a Tenant resource on a client
func CreateTenantFromJSON ¶
CreateTenantFromJSON creates a Tenant resource on a client
func CreateTenantFromYAML ¶
CreateTenantFromYAML creates a Tenant resource on a client
func DeletePipelineRun ¶
func DeletePipelineRun(ctx context.Context, pipelineRun *api.PipelineRun) error
DeletePipelineRun deletes a Tenant resource from a client
func DeleteTenant ¶
DeleteTenant deletes a Tenant resource from a client
func ExecutePipelineRunTests ¶
ExecutePipelineRunTests execute a set of testPlans
func GetClientFactory ¶
func GetClientFactory(ctx context.Context) k8s.ClientFactory
GetClientFactory returns the client factory from the context
func GetNamespace ¶
GetNamespace returns the client namespace from the context
func GetPipelineRun ¶
func GetPipelineRun(ctx context.Context) *api.PipelineRun
GetPipelineRun returns the pipeline run from the context
func GetRealmUUID ¶ added in v0.2.0
GetRealmUUID returns an UUID for the test execution
func GetTenantNamespace ¶
GetTenantNamespace returns the tenant namespace from the context
func GetTestName ¶
GetTestName returns the test Name from the context
func GetWaitInterval ¶
GetWaitInterval returns the wait Interval Defaults to 1s if nothing was set
func SetClientFactory ¶
SetClientFactory returns a context with client factory
func SetNamespace ¶
SetNamespace sets the client namespace to the context
func SetPipelineRun ¶
SetPipelineRun sets the Namespace to the context
func SetRealmUUID ¶ added in v0.2.0
SetRealmUUID returns an UUID for the test execution
func SetTenantNamespace ¶
SetTenantNamespace sets the tenant namespace to the context
func SetTestName ¶
SetTestName sets the test Name to the context
func SetWaitInterval ¶
SetWaitInterval sets the test Name to the context
Types ¶
type PipelineRunCheck ¶
type PipelineRunCheck func(*api.PipelineRun) (bool, error)
PipelineRunCheck is a Check for a PipelineRun
func PipelineRunHasStateResult ¶
func PipelineRunHasStateResult(result api.Result) PipelineRunCheck
PipelineRunHasStateResult returns a PipelineRunCheck which Checks if a PipelineRun has a dedicated result
func PipelineRunMessageOnFinished ¶
func PipelineRunMessageOnFinished(message string) PipelineRunCheck
PipelineRunMessageOnFinished returns a PipelineRunCheck which Checks if a PipelineRun has a dedicated message when it is in state finished
type PipelineRunTest ¶
type PipelineRunTest struct { PipelineRun *api.PipelineRun Secrets []*v1.Secret Check PipelineRunCheck Expected string Timeout time.Duration }
PipelineRunTest is a test for a pipeline run
type PipelineRunTestBuilder ¶
type PipelineRunTestBuilder = func(string, *api.CustomJSON) PipelineRunTest
PipelineRunTestBuilder is a funciton creating a PipelineRunTest for a defined Namespace and a buildID for the elasticsearch
type TenantCheck ¶
TenantCheck is a Check for a tenant
func TenantIsReady ¶
func TenantIsReady() TenantCheck
TenantIsReady creates a TenantCheck which Checks if tenant has readyCondition wiht status true
type TenantTest ¶
type TenantTest struct {
// contains filtered or unexported fields
}
TenantTest is a test for a Tenant
func TenantSuccessTest ¶
func TenantSuccessTest(ctx context.Context) TenantTest
TenantSuccessTest is a test Checking if a tenant was created successfully
type TestPlan ¶
type TestPlan struct { Name string TestBuilder PipelineRunTestBuilder Count int ParallelCreation bool CreationDelay time.Duration Cleanup bool }
TestPlan defines a test plan
type WaitConditionFunc ¶
WaitConditionFunc is a function waiting for a condition return true,nil if condition is fullfilled return false,nil if condition may be fullfilled in the future returns nil,error if condition is not fullfilled
func CreatePipelineRunCondition ¶
func CreatePipelineRunCondition(pipelineRunToFind *api.PipelineRun, check PipelineRunCheck) WaitConditionFunc
CreatePipelineRunCondition returns a WaitCondition for a PipelineRun with a dedicated PipelineCheck
func CreateTenantCondition ¶
func CreateTenantCondition(tenant *api.Tenant, Check TenantCheck) WaitConditionFunc
CreateTenantCondition creates a WaitCondition for a tenant with a dedicated Check