test_tools

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobIdVar     = "CI_JOB_ID"
	CommitSHAVar = "CI_COMMIT_SHA"
)

Variables

This section is empty.

Functions

func ApplyAndAssertError added in v0.15.0

func ApplyAndAssertError(t *testing.T, moduleVars map[string]any, wantErr bool)

func ApplyAndAssertOutputs added in v0.15.0

func ApplyAndAssertOutputs(t *testing.T, moduleVars map[string]any, expectedOutputs map[string]any)

func ApplyE added in v0.15.0

func ApplyE(t *testing.T, moduleVars map[string]any) (map[string]any, error)

func AssertProviderConfigExists

func AssertProviderConfigExists(t *testing.T, plan *terraform.PlanStruct, name string)

func AssertWithPlan

func AssertWithPlan(t *testing.T, plan *terraform.PlanStruct, expectedModules []string)

func JobName

func JobName(t *testing.T) string

JobName returns a unique name for a test that can be used for terraform resources. It should allow integration tests against the same cloud provider to run in parallel without conflicts.

func Plan

func Plan(t *testing.T, moduleVars map[string]any) *terraform.PlanStruct

func PlanAndAssert

func PlanAndAssert(t *testing.T, moduleVars map[string]any, expectedModules []string)

func PlanAndAssertError

func PlanAndAssertError(t *testing.T, moduleVars map[string]any, wantErr bool)

func PlanE added in v0.13.0

func PlanE(t *testing.T, moduleVars map[string]any) (*terraform.PlanStruct, error)

func ToModuleVars added in v0.15.0

func ToModuleVars(t *testing.T, obj any) map[string]any

ToModuleVars uses json marshalling to convert a struct to map[string]any Fields need `json` tags to ensure they are encoded correctly.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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