workflows

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package workflows provides Terratest-style helpers for testing Argo Workflows. These include functions to wait for specific workflow phases (Succeeded, Failed, etc.), and utilities to assert workflow conditions using the Argo Workflows clientset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForCronWorkflowActive

func WaitForCronWorkflowActive(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForCronWorkflowActive waits until the specified Argo CronWorkflow reaches the 'Active' phase within the given timeout. It uses the provided KubectlOptions, workflow name, and namespace for the check. Fails the test if the CronWorkflow does not become active within the timeout.

func WaitForCronWorkflowPhase

func WaitForCronWorkflowPhase(t *testing.T, options *k8s.KubectlOptions, name, namespace string, desiredPhase workflowv1alpha1.CronWorkflowPhase, timeout time.Duration)

WaitForCronWorkflowPhase waits until the specified Argo CronWorkflow reaches the desired phase within the given timeout. It polls the CronWorkflow status at regular intervals and fails the test if the desired phase is not reached in time.

Parameters:

t            - The testing context.
options      - Kubectl options containing Kubernetes REST config.
name         - The name of the CronWorkflow.
namespace    - The namespace of the CronWorkflow.
desiredPhase - The target phase to wait for.
timeout      - The maximum duration to wait for the desired phase.

Fails the test if the CronWorkflow does not reach the desired phase within the timeout.

func WaitForCronWorkflowStopped

func WaitForCronWorkflowStopped(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForCronWorkflowStopped waits until the specified Argo CronWorkflow reaches the "Stopped" phase within the given timeout. It uses the provided testing context, kubectl options, workflow name, and namespace. If the workflow does not reach the "Stopped" phase within the timeout, the test will fail.

func WaitForWorkflowFailed

func WaitForWorkflowFailed(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForWorkflowFailed waits until the specified Argo workflow reaches the "Failed" phase within the given timeout. It uses the provided KubectlOptions to interact with the Kubernetes cluster. Parameters:

  • t: The testing context.
  • options: The kubectl options for accessing the cluster.
  • name: The name of the workflow to monitor.
  • namespace: The namespace where the workflow resides.
  • timeout: The maximum duration to wait for the workflow to enter the "Running" phase.

func WaitForWorkflowPending

func WaitForWorkflowPending(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForWorkflowPending waits until the specified Argo workflow reaches the "Pending" phase within the given timeout. It uses the provided testing context, kubectl options, workflow name, and namespace. If the workflow does not reach the "Pending" phase within the timeout, the test will fail.

func WaitForWorkflowPhase

func WaitForWorkflowPhase(t *testing.T, options *k8s.KubectlOptions, name, namespace string, desiredPhase workflowv1alpha1.WorkflowPhase, timeout time.Duration)

WaitForWorkflowPhase waits until the specified Argo Workflow reaches the desired phase within the given timeout. It polls the workflow status every 2 seconds using the provided Kubernetes options and namespace. If the workflow does not reach the desired phase in time, the test fails with a fatal error.

Parameters:

t            - The testing context.
options      - The Kubernetes KubectlOptions containing REST config.
name         - The name of the workflow to monitor.
namespace    - The namespace where the workflow resides.
desiredPhase - The target WorkflowPhase to wait for.
timeout      - The maximum duration to wait for the workflow to reach the desired phase.

Fails the test if the workflow does not reach the desired phase within the timeout.

func WaitForWorkflowRunning

func WaitForWorkflowRunning(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForWorkflowRunning waits until the specified Argo workflow reaches the "Running" phase within the given timeout. It uses the provided KubectlOptions to interact with the Kubernetes cluster. Parameters:

  • t: The testing context.
  • options: The kubectl options for accessing the cluster.
  • name: The name of the workflow to monitor.
  • namespace: The namespace where the workflow resides.
  • timeout: The maximum duration to wait for the workflow to enter the "Running" phase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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