terratest-utils

module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT

README

Terratest Utils

This package provides a set of helpers for Terratest and general integration testing. It is designed to help validate that platforms and deployments have been successfully provisioned and configured.

Features

  • Utilities for testing Kubernetes resources, including cert-manager, external-secrets, ArgoCD, and Flux
  • Functions to check readiness, status, and correctness of deployed resources
  • Simplifies writing robust integration tests for cloud-native platforms
  • Can be used with Terratest or standalone in Go test suites

Usage

Import the relevant package(s) in your Terratest or Go integration tests:

import (
    "github.com/davidcollom/terratest-utils/pkg/certmanager"
    "github.com/davidcollom/terratest-utils/pkg/externalsecrets"
    // ...other helpers
)

Use the provided functions to validate resources, e.g.:

ready := certmanager.IsCertificateReady(cert)
if !ready {
    t.Fatalf("Certificate is not ready!")
}

Structure

  • pkg/argo/cd - Helpers for ArgoCD resources
  • pkg/argo/events - Helpers for Argo Events resources
  • pkg/argo/workflows - Helpers for Argo Workflows resources
  • pkg/argo/rollouts - Helpers for Argo Rollouts resources
  • pkg/certmanager/ - Helpers for cert-manager resources
  • pkg/externalsecrets/ - Helpers for external-secrets resources
  • pkg/flux/ - Helpers for FluxCD resources

Purpose

These helpers are intended to:

  • Accelerate writing integration tests for Kubernetes platforms
  • Provide reusable checks for resource readiness and correctness
  • Help ensure deployments are successful and meet expected criteria

License

MIT

Directories

Path Synopsis
pkg
argo/cd
Package cd provides Terratest-style helpers for testing Argo CD Applications and AppProjects.
Package cd provides Terratest-style helpers for testing Argo CD Applications and AppProjects.
argo/events
Package events provides Terratest-style helpers for testing Argo Events resources, including EventSources and Sensors.
Package events provides Terratest-style helpers for testing Argo Events resources, including EventSources and Sensors.
argo/rollouts
Package rollouts provides Terratest-style helpers for testing Argo Rollouts.
Package rollouts provides Terratest-style helpers for testing Argo Rollouts.
argo/workflows
Package workflows provides Terratest-style helpers for testing Argo Workflows.
Package workflows provides Terratest-style helpers for testing Argo Workflows.
certmanager
Package certmanager provides Terratest-style helpers for testing cert-manager resources including Certificates, Issuers, ClusterIssuers, CertificateRequests, ACME Orders, and Challenges.
Package certmanager provides Terratest-style helpers for testing cert-manager resources including Certificates, Issuers, ClusterIssuers, CertificateRequests, ACME Orders, and Challenges.
externalsecrets
Package externalsecrets provides Terratest-style helpers for testing External Secrets Operator (ESO) resources including SecretStores, ClusterSecretStores, ExternalSecrets, and PushSecrets.
Package externalsecrets provides Terratest-style helpers for testing External Secrets Operator (ESO) resources including SecretStores, ClusterSecretStores, ExternalSecrets, and PushSecrets.
flux
Package flux provides Terratest-style helpers for testing Flux resources such as Kustomizations, HelmReleases, GitRepositories, and HelmRepositories.
Package flux provides Terratest-style helpers for testing Flux resources such as Kustomizations, HelmReleases, GitRepositories, and HelmRepositories.
k8s
velero
Package velero provides Terratest-style helpers for testing Velero backups, restores, and storage configurations.
Package velero provides Terratest-style helpers for testing Velero backups, restores, and storage configurations.

Jump to

Keyboard shortcuts

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