testing

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MPL-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestTerraformer

type TestTerraformer struct {
	// contains filtered or unexported fields
}

TestTerraformer is an object representing the lifecycle of a particular Terraform project.

Note that Terraform must be installed in the system PATH (not to be confused with the working directory below). This object does not manage anything with regards to installation or version management.

func NewTestTerraformer

func NewTestTerraformer(workDir string, vars ...map[string]string) (*TestTerraformer, error)

NewTestTerraformer initializes a Terraform directory. It just returns an initialized project, it does not perform any actions on it. An optional vars map may be provided; each entry is passed as a -var flag to Terraform commands.

func (*TestTerraformer) Deploy

func (t *TestTerraformer) Deploy() error

Deploy runs the following commands, in order: init, apply, plan, json. The output of the JSON command is then imported to the internal state.

func (*TestTerraformer) Destroy

func (t *TestTerraformer) Destroy() error

Destroy runs the following commands, in order: init, destroy. The state is also cleared.

func (*TestTerraformer) GetOutput

func (t *TestTerraformer) GetOutput(key string) (any, error)

GetOutput returns the value of the output located at key.

Outputs for the root module are supported only. It's an error to run this when no state exists.

func (*TestTerraformer) GetOutputMap

func (t *TestTerraformer) GetOutputMap(key string) (map[string]any, error)

GetOutputMap wraps GetOutput and returns the value as a map. It's an error if the return value is actually not a map.

func (*TestTerraformer) GetOutputSlice

func (t *TestTerraformer) GetOutputSlice(key string) ([]any, error)

GetOutputSlice wraps GetOutput and returns the value as a slice. It's an error if the return value is actually not a slice.

func (*TestTerraformer) GetOutputString

func (t *TestTerraformer) GetOutputString(key string) (string, error)

GetOutputString wraps GetOutput and returns the value as a string. It's an error if the return value is actually not a string.

Jump to

Keyboard shortcuts

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