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 ¶
- func ListArgoClusterWorkflowTemplates(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.ClusterWorkflowTemplate
- func ListArgoWorkflowTaskResults(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTaskResult
- func ListArgoWorkflowTaskSet(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTaskSet
- func ListArgoWorkflowTemplates(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTemplate
- func ListArgoWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.Workflow
- func ListCronWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.CronWorkflow
- func ListWorkflowPhases(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowPhase
- func ListWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.Workflow
- func NewArgoWorkflowsClient(t *testing.T, options *k8s.KubectlOptions) (workflowsClientSet.Interface, error)
- func WaitForCronWorkflowActive(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForCronWorkflowPhase(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForCronWorkflowStopped(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForWorkflowPending(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForWorkflowPhase(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
- func WaitForWorkflowRunning(t *testing.T, options *k8s.KubectlOptions, name, namespace string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListArgoClusterWorkflowTemplates ¶ added in v0.0.5
func ListArgoClusterWorkflowTemplates(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.ClusterWorkflowTemplate
func ListArgoWorkflowTaskResults ¶ added in v0.0.5
func ListArgoWorkflowTaskResults(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTaskResult
func ListArgoWorkflowTaskSet ¶ added in v0.0.5
func ListArgoWorkflowTaskSet(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTaskSet
func ListArgoWorkflowTemplates ¶ added in v0.0.5
func ListArgoWorkflowTemplates(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowTemplate
func ListArgoWorkflows ¶ added in v0.0.5
func ListArgoWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.Workflow
func ListCronWorkflows ¶ added in v0.0.5
func ListCronWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.CronWorkflow
func ListWorkflowPhases ¶ added in v0.0.5
func ListWorkflowPhases(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.WorkflowPhase
func ListWorkflows ¶ added in v0.0.5
func ListWorkflows(t *testing.T, options *k8s.KubectlOptions, namespace string) []workflowv1alpha1.Workflow
func NewArgoWorkflowsClient ¶ added in v0.0.5
func NewArgoWorkflowsClient(t *testing.T, options *k8s.KubectlOptions) (workflowsClientSet.Interface, error)
NewArgoWorkflowsClient creates a new Argo Workflows client using the provided testing context and Kubernetes options. It returns an implementation of the workflowv1alpha1.Interface for interacting with Argo Workflows resources. If the provided KubectlOptions does not include a RestConfig, it attempts to generate one. Returns an error if the client cannot be created.
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 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 ¶
Types ¶
This section is empty.