integration

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 10

README

Integration

A library for writing integration tests against providers.

Documentation

Overview

Package integration is a test library for validating in-memory providers behave correctly.

It sits just above the gRPC level. For full unit testing, see github.com/pulumi/pulumi/pkg/v3/testing/integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LifeCycleTest

type LifeCycleTest struct {
	Resource tokens.Type
	Create   Operation
	Updates  []Operation
}

LifeCycleTest describing the lifecycle of a resource test.

func (LifeCycleTest) Run

func (l LifeCycleTest) Run(t *testing.T, server Server)

Run a resource through it's lifecycle asserting that its output is as expected. The resource is

1. Previewed. 2. Created. 2. Previewed and Updated for each update in the Updates list. 3. Deleted.

type Operation

type Operation struct {
	// The inputs for the operation
	Inputs presource.PropertyMap
	// The expected output for the operation. If ExpectedOutput is nil, no check will be made.
	ExpectedOutput presource.PropertyMap
	// A function called on the output of this operation.
	Hook func(inputs, output presource.PropertyMap)
	// If the test should expect the operation to signal an error.
	ExpectFailure bool
	// If CheckFailures is non-nil, expect the check step to fail with the provided output.
	CheckFailures []p.CheckFailure
}

Operation describes a step in a LifeCycleTest.

TODO: Add support for diff verification.

type Server

func NewServer

func NewServer(pkg string, version semver.Version, provider p.Provider) Server

func NewServerWithContext

func NewServerWithContext(ctx context.Context, pkg string, version semver.Version, provider p.Provider) Server

Jump to

Keyboard shortcuts

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