scenario

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPlanOutput = "plan.out"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Stg is the StageClient
	Stg *StageClient
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, workdir string) (*Client, error)

New creates a new Terraform options with default retryable errors and saves it to the workdir This is a wrapper around terraform.WithDefaultRetryableErrors

func NewWithOptions

func NewWithOptions(t *testing.T, workdir string, opts ...OptFn) (*Client, error)

func (*Client) GetAWS

func (c *Client) GetAWS() cloudprovider.AWSAdapter

func (*Client) GetTerraformOptions

func (c *Client) GetTerraformOptions() *terraform.Options

type Config

type Config interface {
	GetTerraformOptions() *terraform.Options
	GetAWS() cloudprovider.AWSAdapter
}

type OptFn

type OptFn func(*Options) error

func WithAWS

func WithAWS(region string) OptFn

func WithVarFiles

func WithVarFiles(workdir string, varFiles ...string) OptFn

func WithVars

func WithVars(vars map[string]interface{}) OptFn

type Options

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

type Stage

type Stage interface {
	DestroyStage(t *testing.T, options *terraform.Options)
	PlanStage(t *testing.T, options *terraform.Options)
	ApplyStage(t *testing.T, options *terraform.Options)
	PlanStageWithExpectedChanges(t *testing.T, options *terraform.Options, expectedChanges int)
	PlanStageWithDetailedExpectedChanges(t *testing.T, options *terraform.Options, expectedAdds, expectedDeletes, expectedUpdates int)
	PlanStageWithAnySortOfChanges(t *testing.T, options *terraform.Options)
	PlanStageExpectedNoChanges(t *testing.T, options *terraform.Options)
	PlanWithSpecificResourcesThatWillChange(t *testing.T, options *terraform.Options, resources []string)
	PlanWithResourcesExpectedToBeCreated(t *testing.T, options *terraform.Options, resources []string)
	PlanWithResourcesExpectedToBeDeleted(t *testing.T, options *terraform.Options, resources []string)
	PlanWithResourcesExpectedToBeUpdated(t *testing.T, options *terraform.Options, resources []string)
	PlanWithSpecificVariableValueToExpect(t *testing.T, options *terraform.Options, variable, value string)
}

type StageClient

type StageClient struct{}

func (*StageClient) ApplyStage

func (c *StageClient) ApplyStage(t *testing.T, options *terraform.Options)

func (*StageClient) CheckResourcesChanges

func (c *StageClient) CheckResourcesChanges(t *testing.T, options *terraform.Options, resources []string, check func(tfjson.Actions) bool, failMsg string)

CheckResourcesChanges checks if the specified resources have the expected changes The check function is used to determine if the resource has the expected change

func (*StageClient) DestroyStage

func (c *StageClient) DestroyStage(t *testing.T, options *terraform.Options)

func (*StageClient) PlanStage

func (c *StageClient) PlanStage(t *testing.T, options *terraform.Options)

func (*StageClient) PlanStageExpectedNoChanges

func (c *StageClient) PlanStageExpectedNoChanges(t *testing.T, options *terraform.Options)

func (*StageClient) PlanStageWithAnySortOfChanges

func (c *StageClient) PlanStageWithAnySortOfChanges(t *testing.T, options *terraform.Options)

func (*StageClient) PlanStageWithDetailedExpectedChanges

func (c *StageClient) PlanStageWithDetailedExpectedChanges(t *testing.T, options *terraform.Options, expectedAdds, expectedDeletes, expectedUpdates int)

func (*StageClient) PlanStageWithExpectedChanges

func (c *StageClient) PlanStageWithExpectedChanges(t *testing.T, options *terraform.Options, expectedChanges int)

func (*StageClient) PlanWithResourcesExpectedToBeCreated

func (c *StageClient) PlanWithResourcesExpectedToBeCreated(t *testing.T, options *terraform.Options, resources []string)

func (*StageClient) PlanWithResourcesExpectedToBeDeleted

func (c *StageClient) PlanWithResourcesExpectedToBeDeleted(t *testing.T, options *terraform.Options, resources []string)

func (*StageClient) PlanWithResourcesExpectedToBeUpdated

func (c *StageClient) PlanWithResourcesExpectedToBeUpdated(t *testing.T, options *terraform.Options, resources []string)

func (*StageClient) PlanWithSpecificResourcesThatWillChange

func (c *StageClient) PlanWithSpecificResourcesThatWillChange(t *testing.T, options *terraform.Options, resources []string)

func (*StageClient) PlanWithSpecificVariableValueToExpect

func (c *StageClient) PlanWithSpecificVariableValueToExpect(t *testing.T, options *terraform.Options, variable, expectedValue string)

Jump to

Keyboard shortcuts

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