Documentation ¶
Index ¶
- func AssertDisplay(t TB, events []engine.Event, path string)
- func CloneSnapshot(t TB, snap *deploy.Snapshot) *deploy.Snapshot
- type Result
- type TB
- type TestBuilder
- type TestOp
- func (op TestOp) Plan(project workspace.Project, target deploy.Target, opts TestUpdateOptions, ...) (*deploy.Plan, error)
- func (op TestOp) Run(project workspace.Project, target deploy.Target, opts TestUpdateOptions, ...) (*deploy.Snapshot, error)
- func (op TestOp) RunStep(project workspace.Project, target deploy.Target, opts TestUpdateOptions, ...) (*deploy.Snapshot, error)
- func (op TestOp) RunWithContext(callerCtx context.Context, project workspace.Project, target deploy.Target, ...) (*deploy.Snapshot, error)
- func (op TestOp) RunWithContextStep(callerCtx context.Context, project workspace.Project, target deploy.Target, ...) (*deploy.Snapshot, error)
- type TestPlan
- func (p *TestPlan) GetProject() workspace.Project
- func (p *TestPlan) GetTarget(t TB, snapshot *deploy.Snapshot) deploy.Target
- func (p *TestPlan) NewProviderURN(pkg tokens.Package, name string, parent resource.URN) resource.URN
- func (p *TestPlan) NewURN(typ tokens.Type, name string, parent resource.URN) resource.URN
- func (p *TestPlan) Run(t TB, snapshot *deploy.Snapshot) *deploy.Snapshot
- func (p *TestPlan) RunWithName(t TB, snapshot *deploy.Snapshot, name string) *deploy.Snapshot
- type TestStep
- type TestUpdateOptions
- type ValidateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TB ¶
type TB interface { Helper() Name() string Logf(format string, args ...any) Log(args ...any) Skipf(format string, args ...any) Skip(args ...any) SkipNow() Errorf(format string, args ...any) Error(args ...any) Fatalf(format string, args ...any) Fatal(args ...any) FailNow() Fail() Failed() bool }
TB is a subset of testing.TB that admits other T-like things, such as *rapid.T from the Rapid property-testing library. It covers the set of functionality that we actually need for lifecycle testing, and satisfies the interfaces of testify.assert and testify.require.
type TestBuilder ¶
type TestBuilder struct {
// contains filtered or unexported fields
}
func NewTestBuilder ¶
func NewTestBuilder(t *testing.T, snap *deploy.Snapshot) *TestBuilder
func (*TestBuilder) RunUpdate ¶
func (b *TestBuilder) RunUpdate( program func(info plugin.RunInfo, monitor *deploytest.ResourceMonitor) error, skipDisplayTests bool, ) *Result
func (*TestBuilder) WithProvider ¶
func (b *TestBuilder) WithProvider(name string, version string, prov *deploytest.Provider) *TestBuilder
type TestOp ¶
type TestOp func( engine.UpdateInfo, *engine.Context, engine.UpdateOptions, bool, ) (*deploy.Plan, display.ResourceChanges, error)
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) RunStep ¶
func (op TestOp) RunStep(project workspace.Project, target deploy.Target, opts TestUpdateOptions, dryRun bool, backendClient deploy.BackendClient, validate ValidateFunc, name string, ) (*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)
func (TestOp) RunWithContextStep ¶
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 // contains filtered or unexported fields }
func (*TestPlan) GetProject ¶
func (*TestPlan) NewProviderURN ¶
type TestStep ¶
type TestStep struct { Op TestOp ExpectFailure bool SkipPreview bool Validate ValidateFunc }
func MakeBasicLifecycleSteps ¶
resCount is the expected number of resources registered during this test.
func (*TestStep) ValidateAnd ¶
func (t *TestStep) ValidateAnd(f ValidateFunc)
type TestUpdateOptions ¶
type TestUpdateOptions struct { engine.UpdateOptions // a factory to produce a plugin host for an update operation. HostF deploytest.PluginHostFactory T TB SkipDisplayTests bool }
TestUpdateOptions is UpdateOptions for a TestPlan.
func (TestUpdateOptions) Options ¶
func (o TestUpdateOptions) Options() engine.UpdateOptions
Options produces UpdateOptions for an update operation.
Click to show internal directories.
Click to hide internal directories.