integ

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

README

Integration Tests

[!WARNING] Make sure to build (pnpm compile) before running e2e. terratest only uses the compiled lib folder.

terratest.gruntwork.io is a golang library of modules for IaC testing.

Refer to their excelent Quick Start docs for an introduction on how to use terratest.

Launch an Authenticated AWS Shell.

Run all e2e tests:

[!IMPORTANT] Ensure bun is installed and available on $PATH for terratest to synth. To manually run the integration "apps", use bun run.

go test -v -count 1 -timeout 180m ./...

[!IMPORTANT] Running all e2e tests will take significant amount of time and is not recommended, use individual make targets per namespace: i.e. cd staticsite; make public-website-bucket

Make targets

[!IMPORTANT] If you encounter any issues with the awk commands used, you might need to install GNU versions of these tools via Homebrew and ensure gnubin is first on $PATH.

brew install awk

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t *testing.T, input any, assertions []Assertion)

Assert asserts the given input against the provided assertions. Fails the test if any assertion fails.

func AssertE

func AssertE(input any, assertions []Assertion) error

AssertE asserts the given input against the provided assertions and returns an error if any assertion fails.

func TerraformOutputJMES

func TerraformOutputJMES[T any](t *testing.T, terraformOptions *terraform.Options, query string) T

TerraformOutputJMES calls terraform output, searches values using JMESPath and converts to the desired type. This fails the test on any errors

func TerraformOutputJMESAny

func TerraformOutputJMESAny(t *testing.T, terraformOptions *terraform.Options, query string) interface{}

TerraformOutputJMESAny calls terraform output and searches values using JMESPath. This fails the test on any errors

func TerraformOutputJMESAnyE

func TerraformOutputJMESAnyE(t *testing.T, terraformOptions *terraform.Options, query string) (interface{}, error)

TerraformOutputJMESAnyE calls terraform output and searches values using JMESPath.

Types

type Assertion

type Assertion struct {
	Path           string  // JMESPath of the value to assert
	Exists         bool    // Whether the value should exist, `true` if ExpectedRegexp is provided
	ExpectedRegexp *string // Regexp to match the value against
}

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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