Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateConfig(config *Config) error
- type Config
- type Operation
- func (o *Operation) AfterSuite()
- func (o *Operation) Client() client.Client
- func (o *Operation) Commit() string
- func (o *Operation) EnsureTestNamespace(ctx context.Context) error
- func (o *Operation) GetKubeconfigPath() string
- func (o *Operation) IsLocal() bool
- func (o *Operation) Log() logr.Logger
- func (o *Operation) RunTestrun(ctx context.Context, tr *tmv1beta1.Testrun, phase argov1.WorkflowPhase, ...) (*tmv1beta1.Testrun, *argov1.Workflow, error)
- func (o *Operation) RunTestrunUntilCompleted(ctx context.Context, tr *tmv1beta1.Testrun, phase argov1.WorkflowPhase, ...) (*tmv1beta1.Testrun, *argov1.Workflow, error)
- func (o *Operation) S3Config() (*config.S3, error)
- func (o *Operation) S3Endpoint() string
- func (o *Operation) TestMachineryNamespace() string
- func (o *Operation) TestNamespace() string
- func (o *Operation) WaitForClusterReadiness(maxWaitTime time.Duration) error
- type OperationState
Constants ¶
const (
TestNamespacePrefix = "tm-it"
)
Variables ¶
var (
CoreSecrets = []string{
"s3-secret",
}
)
Functions ¶
func ValidateConfig ¶
ValidateConfig validates a framework configuration
Types ¶
type Config ¶
type Config struct { CommitSha string Namespace string TmKubeconfigPath string TmNamespace string S3Endpoint string Local bool TMConfigPath string }
Framework operation configuration
func RegisterFlags ¶
RegisterFlags adds all framework operation specific flags to the provided flagset.
type Operation ¶
type Operation struct { State OperationState // contains filtered or unexported fields }
Operation is a common set of configuration and functions for running testmachinery integration tests.
func (*Operation) AfterSuite ¶
func (o *Operation) AfterSuite()
AfterSuite should be registered as ginkgo's after suite. It cleans up all previously created resources that are in the operation state.
func (*Operation) EnsureTestNamespace ¶
EnsureTestNamespace creates the namespace specified in the config it does not exist. if o.config.TestNamespace is empty a random generated namespace will be created. Additionally necessary resources were created and added to the operation state.
func (*Operation) GetKubeconfigPath ¶
GetKubeconfigPath returns the path to the current kubeconfig
func (*Operation) IsLocal ¶
IsLocal indicates if the test is running against a local testmachinery controller
func (*Operation) RunTestrun ¶
func (*Operation) RunTestrunUntilCompleted ¶
func (*Operation) S3Config ¶
S3Config returns the s3 testConfig that is used by the testmachinery to test
func (*Operation) S3Endpoint ¶
func (*Operation) TestMachineryNamespace ¶
TestMachineryNamespace returns the current namespace where the testmachinery components are running.
func (*Operation) TestNamespace ¶
TestNamespace returns the name of the current test namespace
type OperationState ¶
func (*OperationState) AppendObject ¶
func (s *OperationState) AppendObject(obj client.Object)
AppendObject adds a kubernetes objects to the start of the state's objects. These objects are meant to be cleaned up after the test has run.