Documentation
¶
Index ¶
- Constants
- Variables
- func CreateManagedNamespace(name string, managedByNamespace string) *corev1.Namespace
- func CreateManagedNamespaceWithCleanupFunc(name string, managedByNamespace string) (*corev1.Namespace, func())
- func CreateNamespace(name string) *corev1.Namespace
- func CreateNamespaceWithCleanupFunc(name string) (*corev1.Namespace, func())
- func CreateRandomE2ETestNamespace() *corev1.Namespace
- func CreateRandomE2ETestNamespaceWithCleanupFunc() (*corev1.Namespace, func())
- func EnsureParallelCleanSlate()
- func EnsureSequentialCleanSlate()
- func EnsureSequentialCleanSlateWithError() error
- func EnvCI() bool
- func EnvLocalRun() bool
- func EnvNonOLM() bool
- func GetEnvInOperatorSubscriptionOrDeployment(key string) (*string, error)
- func GetSubscriptionInEnvCIEnvironment(k8sClient client.Client) (*olmv1alpha1.Subscription, error)
- func OutputDebugOnFail(namespaceParams ...any)
- func RemoveDynamicPluginFromCSV(ctx context.Context, k8sClient client.Client) error
- func RemoveEnvFromOperatorSubscriptionOrDeployment(key string) error
- func RestoreSubcriptionToDefault() error
- func SetEnvInOperatorSubscriptionOrDeployment(key string, value string)
- func WaitForAllDeploymentsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
- func WaitForAllPodsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
- func WaitForAllStatefulSetsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
Constants ¶
const ( // E2ETestLabelsKey and E2ETestLabelsValue are added to cluster-scoped resources (e.g. Namespaces) created by E2E tests (where possible). On startup (and before each test for sequential tests), any resources with this label will be deleted. E2ETestLabelsKey = "app" E2ETestLabelsValue = "test-argo-app" )
Variables ¶
var NamespaceLabels = map[string]string{E2ETestLabelsKey: E2ETestLabelsValue}
Functions ¶
func CreateManagedNamespace ¶
Create a namespace 'name' that is managed by another namespace 'managedByNamespace', via managed-by label.
func CreateNamespace ¶
Create namespace for tests having a specific label for identification - If the namespace already exists, it will be deleted first
func EnsureParallelCleanSlate ¶
func EnsureParallelCleanSlate()
func EnsureSequentialCleanSlate ¶
func EnsureSequentialCleanSlate()
EnsureSequentialCleanSlate will clean up resources that were created during previous sequential tests - Deletes namespaces that were created by previous tests - Deletes other cluster-scoped resources that were created - Reverts changes made to Subscription CR - etc
func EnsureSequentialCleanSlateWithError ¶
func EnsureSequentialCleanSlateWithError() error
func EnvCI ¶
func EnvCI() bool
EnvCI checks if CI env var is set; this variable is set when testing on GitOps Operator running via CI pipeline (and using an OLM Subscription)
func EnvLocalRun ¶
func EnvLocalRun() bool
func EnvNonOLM ¶
func EnvNonOLM() bool
EnvNonOLM checks if NON_OLM var is set; this variable is set when testing on GitOps operator that is not installed via OLM
func GetEnvInOperatorSubscriptionOrDeployment ¶
GetEnvInOperatorSubscriptionOrDeployment will return the value of an environment variable, in either operator Subscription or operator Deployment, depending on which mode the test is running in.
func GetSubscriptionInEnvCIEnvironment ¶
func GetSubscriptionInEnvCIEnvironment(k8sClient client.Client) (*olmv1alpha1.Subscription, error)
func OutputDebugOnFail ¶
func OutputDebugOnFail(namespaceParams ...any)
OutputDebugOnFail can be used to debug a failing test: it will output the operator logs and namespace info Parameters: - Will output debug information on namespaces specified as parameters. - Namespace parameter may be a string, *Namespace, or Namespace
func RemoveDynamicPluginFromCSV ¶
RemoveDynamicPluginFromCSV ensures that if the CSV in 'openshift-gitops-operator' NS exists, that the CSV does not contain the dynamic plugin env var
func RemoveEnvFromOperatorSubscriptionOrDeployment ¶
RemoveEnvFromOperatorSubscriptionOrDeployment will delete an environment variable from either operator Subscription or operator Deployment, depending on which mode the test is running in.
func RestoreSubcriptionToDefault ¶
func RestoreSubcriptionToDefault() error
RestoreSubcriptionToDefault ensures that the Subscription (or Deployment env vars) are restored to a default state before each test.
func SetEnvInOperatorSubscriptionOrDeployment ¶
SetEnvInOperatorSubscriptionOrDeployment will set the value of an environment variable, in either operator Subscription (under .spec.config.env) or operator Deployment (under template spec), depending on which mode the test is running in.
Types ¶
This section is empty.