testing

package
v3.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveGenerator

func ArchiveGenerator(maxDepth int) *rapid.Generator

ArchiveGenerator generates *resource.Archive values.

func ArchivePropertyGenerator

func ArchivePropertyGenerator(maxDepth int) *rapid.Generator

ArchivePropertyGenerator generates archive resource.PropertyValues.

func ArrayPropertyGenerator

func ArrayPropertyGenerator(maxDepth int) *rapid.Generator

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

AssetGenerator generates *resource.Asset values.

func AssetPropertyGenerator

func AssetPropertyGenerator() *rapid.Generator

AssetPropertyGenerator generates asset resource.PropertyValues.

func BoolPropertyGenerator

func BoolPropertyGenerator() *rapid.Generator

BoolPropertyGenerator generates boolean resource.PropertyValues.

func IDGenerator

func IDGenerator() *rapid.Generator

IDGenerator generates legal resource.ID values.

func LiteralArchiveGenerator

func LiteralArchiveGenerator(maxDepth int) *rapid.Generator

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

func NullPropertyGenerator

func NullPropertyGenerator() *rapid.Generator

NullPropertyGenerator generates the null resource.PropertyValue.

func NumberPropertyGenerator

func NumberPropertyGenerator() *rapid.Generator

NumberPropertyGenerator generates numeric resource.PropertyValues.

func ObjectPropertyGenerator

func ObjectPropertyGenerator(maxDepth int) *rapid.Generator

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

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

PropertyKeyGenerator generates legal resource.PropertyKey values.

func PropertyMapGenerator

func PropertyMapGenerator(maxDepth int) *rapid.Generator

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

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

func ResourceReferenceGenerator

func ResourceReferenceGenerator() *rapid.Generator

ResourceReferenceGenerator generates resource.ResourceReference values.

func ResourceReferencePropertyGenerator

func ResourceReferencePropertyGenerator() *rapid.Generator

ResourceReferencePropertyGenerator generates resource reference resource.PropertyValues.

func SecretPropertyGenerator

func SecretPropertyGenerator(maxDepth int) *rapid.Generator

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

SemverStringGenerator generates legal semver strings.

func StringPropertyGenerator

func StringPropertyGenerator() *rapid.Generator

StringPropertyGenerator generates string resource.PropertyValues.

func TextAssetGenerator

func TextAssetGenerator() *rapid.Generator

TextAssetGenerator generates textual *resource.Asset values.

func TypeGenerator

func TypeGenerator() *rapid.Generator

TypeGenerator generates legal tokens.Type values.

func URNGenerator

func URNGenerator() *rapid.Generator

URNGenerator generates legal resource.URN values.

func UnknownPropertyGenerator

func UnknownPropertyGenerator() *rapid.Generator

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

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

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

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

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

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

ResourceReferenceGenerator generates resource.ResourceReference values. The referenced resource is

func (*StackContext) ResourceReferencePropertyGenerator added in v3.14.0

func (ctx *StackContext) ResourceReferencePropertyGenerator() *rapid.Generator

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

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

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

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