testing

package
v3.114.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveGenerator

func ArchiveGenerator(maxDepth int) *rapid.Generator[*archive.Archive]

ArchiveGenerator generates *archive.Archive values.

func ArchivePropertyGenerator

func ArchivePropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

ArchivePropertyGenerator generates archive resource.PropertyValues.

func ArrayPropertyGenerator

func ArrayPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

ArrayPropertyGenerator generates array resource.PropertyValues. The maxDepth parameter controls the maximum depth of the elements of the array.

func AssertEqualPropertyValues

func AssertEqualPropertyValues(t assert.TestingT, expected, actual resource.PropertyValue)

func AssetGenerator

func AssetGenerator() *rapid.Generator[*asset.Asset]

AssetGenerator generates *asset.Asset values.

func AssetPropertyGenerator

func AssetPropertyGenerator() *rapid.Generator[resource.PropertyValue]

AssetPropertyGenerator generates asset resource.PropertyValues.

func BoolPropertyGenerator

func BoolPropertyGenerator() *rapid.Generator[resource.PropertyValue]

BoolPropertyGenerator generates boolean resource.PropertyValues.

func IDGenerator

func IDGenerator() *rapid.Generator[resource.ID]

IDGenerator generates legal resource.ID values.

func LiteralArchiveGenerator

func LiteralArchiveGenerator(maxDepth int) *rapid.Generator[*archive.Archive]

LiteralArchiveGenerator generates *archive.Archive values with literal archive contents.

func NullPropertyGenerator

func NullPropertyGenerator() *rapid.Generator[resource.PropertyValue]

NullPropertyGenerator generates the null resource.PropertyValue.

func NumberPropertyGenerator

func NumberPropertyGenerator() *rapid.Generator[resource.PropertyValue]

NumberPropertyGenerator generates numeric resource.PropertyValues.

func ObjectPropertyGenerator

func ObjectPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

ObjectPropertyGenerator generates object resource.PropertyValues. The maxDepth parameter controls the maximum depth of the elements of the object.

func OutputPropertyGenerator

func OutputPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

OutputPropertyGenerator generates output resource.PropertyValues. The maxDepth parameter controls the maximum depth of the resolved value of the output, if any. If a StackContext, the output's dependencies will only refer to resources in the context.

func PropertyKeyGenerator

func PropertyKeyGenerator() *rapid.Generator[resource.PropertyKey]

PropertyKeyGenerator generates legal resource.PropertyKey values.

func PropertyMapGenerator

func PropertyMapGenerator(maxDepth int) *rapid.Generator[resource.PropertyMap]

PropertyMapGenerator generates resource.PropertyMap values. The maxDepth parameter controls the maximum depth of the elements of the map.

func PropertyValueGenerator

func PropertyValueGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

PropertyValueGenerator generates arbitrary resource.PropertyValues. The maxDepth parameter controls the maximum number of times the generator may recur.

func ResourceReferenceGenerator

func ResourceReferenceGenerator() *rapid.Generator[resource.ResourceReference]

ResourceReferenceGenerator generates resource.ResourceReference values.

func ResourceReferencePropertyGenerator

func ResourceReferencePropertyGenerator() *rapid.Generator[resource.PropertyValue]

ResourceReferencePropertyGenerator generates resource reference resource.PropertyValues.

func SecretPropertyGenerator

func SecretPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

SecretPropertyGenerator generates secret resource.PropertyValues. The maxDepth parameter controls the maximum depth of the plaintext value of the secret, if any.

func SemverStringGenerator

func SemverStringGenerator() *rapid.Generator[string]

SemverStringGenerator generates legal semver strings.

func StringPropertyGenerator

func StringPropertyGenerator() *rapid.Generator[resource.PropertyValue]

StringPropertyGenerator generates string resource.PropertyValues.

func TextAssetGenerator

func TextAssetGenerator() *rapid.Generator[*asset.Asset]

TextAssetGenerator generates textual *asset.Asset values.

func TypeGenerator

func TypeGenerator() *rapid.Generator[tokens.Type]

TypeGenerator generates legal tokens.Type values.

func URNGenerator

func URNGenerator() *rapid.Generator[resource.URN]

URNGenerator generates legal resource.URN values.

func UnknownPropertyGenerator

func UnknownPropertyGenerator() *rapid.Generator[resource.PropertyValue]

UnknownPropertyGenerator generates the unknown resource.PropertyValue.

Types

type StackContext added in v3.14.0

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

A StackContext provides context for generating URNs and references to resources.

func NewStackContext added in v3.14.0

func NewStackContext(projectName, stackName string, resources ...*resource.State) *StackContext

NewStackContext creates a new stack context with the given project name, stack name, and list of resources.

func (*StackContext) Append added in v3.14.0

func (ctx *StackContext) Append(r ...*resource.State) *StackContext

Append creates a new context that contains the current context's resources and the given list of resources.

func (*StackContext) ArrayPropertyGenerator added in v3.14.0

func (ctx *StackContext) ArrayPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

ArrayPropertyGenerator generates array resource.PropertyValues. The maxDepth parameter controls the maximum depth of the elements of the array.

func (*StackContext) ObjectPropertyGenerator added in v3.14.0

func (ctx *StackContext) ObjectPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

ObjectPropertyGenerator generates object resource.PropertyValues. The maxDepth parameter controls the maximum depth of the elements of the object.

func (*StackContext) OutputPropertyGenerator added in v3.14.0

func (ctx *StackContext) OutputPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

OutputPropertyGenerator generates output resource.PropertyValues. The maxDepth parameter controls the maximum depth of the resolved value of the output, if any. The output's dependencies will only refer to resources in the context.

func (*StackContext) ProjectName added in v3.14.0

func (ctx *StackContext) ProjectName() string

ProjectName returns the context's project name.

func (*StackContext) PropertyMapGenerator added in v3.14.0

func (ctx *StackContext) PropertyMapGenerator(maxDepth int) *rapid.Generator[resource.PropertyMap]

PropertyMapGenerator generates resource.PropertyMap values. The maxDepth parameter controls the maximum depth of the elements of the map.

func (*StackContext) PropertyValueGenerator added in v3.14.0

func (ctx *StackContext) PropertyValueGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

PropertyValueGenerator generates arbitrary resource.PropertyValues. The maxDepth parameter controls the maximum number of times the generator may recur.

func (*StackContext) ResourceReferenceGenerator added in v3.14.0

func (ctx *StackContext) ResourceReferenceGenerator() *rapid.Generator[resource.ResourceReference]

ResourceReferenceGenerator generates resource.ResourceReference values. The referenced resource is

func (*StackContext) ResourceReferencePropertyGenerator added in v3.14.0

func (ctx *StackContext) ResourceReferencePropertyGenerator() *rapid.Generator[resource.PropertyValue]

ResourceReferencePropertyGenerator generates resource reference resource.PropertyValues.

func (*StackContext) Resources added in v3.14.0

func (ctx *StackContext) Resources() []*resource.State

Resources returns the context's resources.

func (*StackContext) SecretPropertyGenerator added in v3.14.0

func (ctx *StackContext) SecretPropertyGenerator(maxDepth int) *rapid.Generator[resource.PropertyValue]

SecretPropertyGenerator generates secret resource.PropertyValues. The maxDepth parameter controls the maximum depth of the plaintext value of the secret, if any.

func (*StackContext) StackName added in v3.14.0

func (ctx *StackContext) StackName() string

StackName returns the context's stack name.

func (*StackContext) URNGenerator added in v3.14.0

func (ctx *StackContext) URNGenerator() *rapid.Generator[resource.URN]

URNGenerator generates URNs that are valid within the context (i.e. the project name and stack name portions of the generated URNs will always be taken from the context).

func (*StackContext) URNSampler added in v3.14.0

func (ctx *StackContext) URNSampler() *rapid.Generator[resource.URN]

URNSampler samples URNs from the stack's resources.

Jump to

Keyboard shortcuts

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