Documentation
¶
Index ¶
- Constants
- Variables
- func CreateClusterScopedManagedNamespace(name string, managedByArgoCDInstance string) *corev1.Namespace
- func CreateClusterScopedManagedNamespaceWithCleanupFunc(name string, managedByArgoCDInstance string) (*corev1.Namespace, func())
- 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 DeleteNamespace(ns *corev1.Namespace)
- func EnsureParallelCleanSlate()
- func EnsureRunningOnOpenShift()
- func EnsureSequentialCleanSlate()
- func EnsureSequentialCleanSlateWithError() error
- func EnvCI() bool
- func EnvLocalRun() bool
- func EnvNonOLM() bool
- func IsUpstreamOperatorTests() bool
- func OutputDebugOnFail(namespaceParams ...any)
- func RunningOnOpenShift() bool
- func WaitForAllDeploymentsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
- func WaitForAllPodsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
- func WaitForAllStatefulSetsInTheNamespaceToBeReady(ns string, k8sClient client.Client)
- func WaitForRootPartitionToHaveMinimumDiskSpace()
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 CreateClusterScopedManagedNamespace ¶
func CreateClusterScopedManagedNamespace(name string, managedByArgoCDInstance string) *corev1.Namespace
Create a namespace 'name' that is managed by a cluster-scoped ArgoCD instance, via managed-by-cluster-argocd label.
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 DeleteNamespace ¶
func EnsureParallelCleanSlate ¶
func EnsureParallelCleanSlate()
func EnsureRunningOnOpenShift ¶
func EnsureRunningOnOpenShift()
EnsureRunningOnOpenShift should be called if a test requires OpenShift (for example, it uses Route CR).
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 IsUpstreamOperatorTests ¶
func IsUpstreamOperatorTests() bool
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 RunningOnOpenShift ¶
func RunningOnOpenShift() bool
RunningOnOpenShift returns true if the cluster is an OpenShift cluster, false otherwise.
func WaitForRootPartitionToHaveMinimumDiskSpace ¶
func WaitForRootPartitionToHaveMinimumDiskSpace()
waitForRootPartitionToHaveMinimumDiskSpace: - When running via GitHub (GH) action, the E2E test environment has only ~14GiB of disk space available. - As the E2E tests run, and as the K8s cluster persists data, that available storage drops over time. - This drop is especially significant during parallel test execution, as multiple Argo CD instances are running/logging at the same time. - When the available disk space drops to 4GiB, the K8s instance will start to arbitrarily evict pods, which causes tests to intermittently fail. - As a workaround (since we can't increase the GH action env), each parallel test will wait for a minimum of disk space before starting. - Before each parallel test, we thus run `df` command and wait for it to tell use that >= 7 GiB of disk space is available.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
promoterFixture provides helpful functions for the GitOps Promoter E2E tests
|
promoterFixture provides helpful functions for the GitOps Promoter E2E tests |