tftest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTerraformProject

func CreateTerraformProject(tmpDir string, tfProject TerraformProject) (string, error)

func EnsurePluginsInstalled

func EnsurePluginsInstalled()

func GoldenFileHCLResourceTestsWithOpts

func GoldenFileHCLResourceTestsWithOpts(t *testing.T, testName string, options *GoldenFileOptions, ctxOptions ...func(ctx *settings.Session))

func GoldenFileResourceTests

func GoldenFileResourceTests(t *testing.T, testName string)

func GoldenFileResourceTestsWithOpts

func GoldenFileResourceTestsWithOpts(t *testing.T, testName string, options *GoldenFileOptions, ctxOptions ...func(ctx *settings.Session))

func GoldenFileUsageSyncTest

func GoldenFileUsageSyncTest(t *testing.T, testName string, ctxOptions ...func(ctx *settings.Session))

func ResourceTests

func ResourceTests(t *testing.T, tf string, usage engine.ConsumptionMap, checks []testutil.ResourceCheck)

func ResourceTestsForTerraformProject

func ResourceTestsForTerraformProject(t *testing.T, tfProject TerraformProject, usage engine.ConsumptionMap, checks []testutil.ResourceCheck, ctxOptions ...func(ctx *settings.Session))

func RunCostCalculations

func RunCostCalculations(runCtx *settings.Session, projects []*engine.Workspace) ([]*engine.Workspace, error)

func RunSyncUsage

func RunSyncUsage(t *testing.T, projectCtx *settings.ProjectSession, projects []*engine.Workspace, usageFilePath string) []byte

func WithProviders

func WithProviders(tf string) string

Types

type File

type File struct {
	Path     string
	Contents string
}

type GoldenFileOptions

type GoldenFileOptions = struct {
	Currency         string
	CaptureLogs      bool
	IgnoreCLI        bool
	LogLevel         *string
	ProjectMetadata  map[string]string
	GoldenFileSuffix string
}

func DefaultGoldenFileOptions

func DefaultGoldenFileOptions() *GoldenFileOptions

type TerraformProject

type TerraformProject struct {
	Files []File
}

Jump to

Keyboard shortcuts

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