lifecycletest

package
v3.114.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneSnapshot

func CloneSnapshot(t testing.TB, snap *deploy.Snapshot) *deploy.Snapshot

CloneSnapshot makes a deep copy of the given snapshot and returns a pointer to the clone.

Types

type Result added in v3.97.0

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

func (*Result) Then added in v3.97.0

func (res *Result) Then(do func(snap *deploy.Snapshot, err error))

Then() is used to convey dependence between program runs via program structure.

type TestOp

type TestOp func(UpdateInfo, *Context, UpdateOptions, bool) (*deploy.Plan, display.ResourceChanges, error)

func ImportOp

func ImportOp(imports []deploy.Import) TestOp

func (TestOp) Plan

func (op TestOp) Plan(project workspace.Project, target deploy.Target, opts TestUpdateOptions,
	backendClient deploy.BackendClient, validate ValidateFunc,
) (*deploy.Plan, error)

func (TestOp) Run

func (op TestOp) Run(project workspace.Project, target deploy.Target, opts TestUpdateOptions,
	dryRun bool, backendClient deploy.BackendClient, validate ValidateFunc,
) (*deploy.Snapshot, error)

func (TestOp) RunWithContext

func (op TestOp) RunWithContext(
	callerCtx context.Context, project workspace.Project,
	target deploy.Target, opts TestUpdateOptions, dryRun bool,
	backendClient deploy.BackendClient, validate ValidateFunc,
) (*deploy.Snapshot, error)

type TestPlan

type TestPlan struct {
	Project        string
	Stack          string
	Runtime        string
	RuntimeOptions map[string]interface{}
	Config         config.Map
	Decrypter      config.Decrypter
	BackendClient  deploy.BackendClient
	Options        TestUpdateOptions
	Steps          []TestStep
}

func (*TestPlan) GetProject

func (p *TestPlan) GetProject() workspace.Project

func (*TestPlan) GetTarget

func (p *TestPlan) GetTarget(t testing.TB, snapshot *deploy.Snapshot) deploy.Target

func (*TestPlan) NewProviderURN

func (p *TestPlan) NewProviderURN(pkg tokens.Package, name string, parent resource.URN) resource.URN

func (*TestPlan) NewURN

func (p *TestPlan) NewURN(typ tokens.Type, name string, parent resource.URN) resource.URN

func (*TestPlan) Run

func (p *TestPlan) Run(t testing.TB, snapshot *deploy.Snapshot) *deploy.Snapshot

type TestStep

type TestStep struct {
	Op            TestOp
	ExpectFailure bool
	SkipPreview   bool
	Validate      ValidateFunc
}

func MakeBasicLifecycleSteps

func MakeBasicLifecycleSteps(t *testing.T, resCount int) []TestStep

resCount is the expected number of resources registered during this test.

func (*TestStep) ValidateAnd

func (t *TestStep) ValidateAnd(f ValidateFunc)

type TestUpdateOptions added in v3.87.0

type TestUpdateOptions struct {
	UpdateOptions
	// a factory to produce a plugin host for an update operation.
	HostF deploytest.PluginHostFactory
}

TestUpdateOptions is UpdateOptions for a TestPlan.

func (TestUpdateOptions) Options added in v3.87.0

func (o TestUpdateOptions) Options() UpdateOptions

Options produces UpdateOptions for an update operation.

type ValidateFunc

type ValidateFunc func(project workspace.Project, target deploy.Target, entries JournalEntries,
	events []Event, err error) error

Jump to

Keyboard shortcuts

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