testutil

package
v0.10.35 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertGoldenFile added in v0.9.7

func AssertGoldenFile(t *testing.T, goldenFilePath string, actual []byte) bool

func CalcGoldenFileTestdataDirName added in v0.9.7

func CalcGoldenFileTestdataDirName() string

func ConfigureTestToCaptureLogs added in v0.9.7

func ConfigureTestToCaptureLogs(t *testing.T, runCtx *config.RunContext) *bytes.Buffer

func ConfigureTestToFailOnLogs added in v0.9.7

func ConfigureTestToFailOnLogs(t *testing.T, runCtx *config.RunContext)

func CreateDirectoryStructure added in v0.10.32

func CreateDirectoryStructure(t *testing.T, treeOutputLocation string, tmpDir string)

CreateDirectoryStructure reads a tree command output file and creates the directory structure in the specified temp directory.

func FindDirectoriesWithTreeFile added in v0.10.32

func FindDirectoriesWithTreeFile(t *testing.T, baseDir string) []string

FindDirectoriesWithTreeFile finds and returns a slice of directory paths within the given base directory that contain a "tree.txt" file.

func TestCostComponents

func TestCostComponents(t *testing.T, costComponents []*schema.CostComponent, checks []CostComponentCheck)

func TestResources

func TestResources(t *testing.T, resources []*schema.Resource, checks []ResourceCheck)

Types

type CostCheckFunc

type CostCheckFunc func(*testing.T, *schema.CostComponent)

func HourlyPriceMultiplierCheck

func HourlyPriceMultiplierCheck(multiplier decimal.Decimal) CostCheckFunc

func MonthlyPriceMultiplierCheck

func MonthlyPriceMultiplierCheck(multiplier decimal.Decimal) CostCheckFunc

func NilMonthlyCostCheck added in v0.7.0

func NilMonthlyCostCheck() CostCheckFunc

type CostComponentCheck

type CostComponentCheck struct {
	Name             string
	PriceHash        string
	SkipCheck        bool
	HourlyCostCheck  CostCheckFunc
	MonthlyCostCheck CostCheckFunc
}

type ErrorOnAnyWriter added in v0.9.7

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

func (ErrorOnAnyWriter) Write added in v0.9.7

func (e ErrorOnAnyWriter) Write(data []byte) (n int, err error)

type ResourceCheck

type ResourceCheck struct {
	Name                string
	SkipCheck           bool
	CostComponentChecks []CostComponentCheck
	SubResourceChecks   []ResourceCheck
}

Jump to

Keyboard shortcuts

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