test

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtyTestDiff

func CtyTestDiff(got []*resource.Resource, dirName string, provider terraform.TerraformProvider, deserializer *resource.Deserializer, shouldUpdate bool, t *testing.T)

CtyTestDiff Deprecated

func Execute

func Execute(cmd *cobra.Command, args ...string) (output string, err error)

func ExecuteC

func ExecuteC(cmd *cobra.Command, args ...string) (c *cobra.Command, output string, err error)

func ReadTestFile

func ReadTestFile(p string) ([]byte, error)

func TestAgainstGoldenFile

func TestAgainstGoldenFile(
	got []*resource.Resource,
	ty string,
	dirName string,
	provider terraform.TerraformProvider,
	deserializer *resource.Deserializer,
	shouldUpdate bool,
	tt *testing.T,
)

func TestAgainstGoldenFileNoCty added in v0.37.0

func TestAgainstGoldenFileNoCty(
	got []*resource.Resource,
	ty string,
	dirName string,
	_ terraform.TerraformProvider,
	_ *resource.Deserializer,
	shouldUpdate bool,
	tt *testing.T)

That method is used to compare the result of the enumeration with the golden file. That method does not use cty and types from the terraform provider to deserialize resources. Some resources returned by the enumeration may have missing fields, and if we use cty deserialization we're gonna recreate those missing fields to respect the schema.

func WriteTestFile

func WriteTestFile(p string, content []byte) error

Types

type Build

type Build struct{}

func (Build) IsRelease

func (b Build) IsRelease() bool

func (Build) IsUsageReportingEnabled

func (b Build) IsUsageReportingEnabled() bool

type ScanResult

type ScanResult struct {
	*require.Assertions
	*analyser.Analysis
}

func NewScanResult

func NewScanResult(t *testing.T, analysis *analyser.Analysis) *ScanResult

func (*ScanResult) AssertCoverage

func (r *ScanResult) AssertCoverage(expected int)

func (*ScanResult) AssertDeletedCount

func (r *ScanResult) AssertDeletedCount(count int)

func (ScanResult) AssertInfrastructureIsInSync

func (r ScanResult) AssertInfrastructureIsInSync()

func (ScanResult) AssertInfrastructureIsNotSync

func (r ScanResult) AssertInfrastructureIsNotSync()

func (*ScanResult) AssertManagedCount

func (r *ScanResult) AssertManagedCount(count int)

func (*ScanResult) AssertResourceDeleted

func (r *ScanResult) AssertResourceDeleted(id, ty string)

func (*ScanResult) AssertResourceUnmanaged

func (r *ScanResult) AssertResourceUnmanaged(id, ty string)

func (*ScanResult) AssertUnmanagedCount

func (r *ScanResult) AssertUnmanagedCount(count int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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