Help us shape the future of Go! Take the 2026 Go Developer Survey

fixture

package
v0.0.0-...-da817c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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

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 CreateClusterScopedManagedNamespaceWithCleanupFunc

func CreateClusterScopedManagedNamespaceWithCleanupFunc(name string, managedByArgoCDInstance string) (*corev1.Namespace, func())

func CreateManagedNamespace

func CreateManagedNamespace(name string, managedByNamespace string) *corev1.Namespace

Create a namespace 'name' that is managed by another namespace 'managedByNamespace', via managed-by label.

func CreateManagedNamespaceWithCleanupFunc

func CreateManagedNamespaceWithCleanupFunc(name string, managedByNamespace string) (*corev1.Namespace, func())

func CreateNamespace

func CreateNamespace(name string) *corev1.Namespace

Create namespace for tests having a specific label for identification - If the namespace already exists, it will be deleted first

func CreateNamespaceWithCleanupFunc

func CreateNamespaceWithCleanupFunc(name string) (*corev1.Namespace, func())

func CreateRandomE2ETestNamespace

func CreateRandomE2ETestNamespace() *corev1.Namespace

func CreateRandomE2ETestNamespaceWithCleanupFunc

func CreateRandomE2ETestNamespaceWithCleanupFunc() (*corev1.Namespace, func())

func DeleteNamespace

func DeleteNamespace(ns *corev1.Namespace)

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 WaitForAllDeploymentsInTheNamespaceToBeReady

func WaitForAllDeploymentsInTheNamespaceToBeReady(ns string, k8sClient client.Client)

func WaitForAllPodsInTheNamespaceToBeReady

func WaitForAllPodsInTheNamespaceToBeReady(ns string, k8sClient client.Client)

func WaitForAllStatefulSetsInTheNamespaceToBeReady

func WaitForAllStatefulSetsInTheNamespaceToBeReady(ns string, k8sClient client.Client)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL