tester

package
v1.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tester

type Tester struct {

	// TestDir is the temp directory created for the test.
	TestDir string

	// PorterHomeDir is the temp PORTER_HOME directory for the test.
	PorterHomeDir string

	// RepoRoot is the root of the porter repository.
	// Useful for constructing paths that won't break when the test is moved.
	RepoRoot string

	// T is the test helper.
	T *testing.T
	// contains filtered or unexported fields
}

func NewTest

func NewTest(t *testing.T) (Tester, error)

NewTest sets up for a smoke test.

Always defer Tester.Teardown(), even when an error is returned.

func (Tester) CurrentNamespace

func (t Tester) CurrentNamespace() string

CurrentNamespace configured in config.toml

func (Tester) ListInstallations

func (t Tester) ListInstallations(allNamespaces bool, namespace string, name string, labels []string) ([]claims.Installation, error)

func (Tester) MakeTestBundle

func (t Tester) MakeTestBundle(name string, ref string)

func (Tester) PrepareTestBundle

func (t Tester) PrepareTestBundle()

PrepareTestBundle ensures that the mybuns test bundle has been built.

func (Tester) RequireInstallationExists

func (t Tester) RequireInstallationExists(namespace string, name string) claims.Installation

func (Tester) RequireInstallationInList

func (t Tester) RequireInstallationInList(namespace, name string, list []claims.Installation) claims.Installation

func (Tester) RequireInstallationNotFound

func (t Tester) RequireInstallationNotFound(namespace string, name string)

func (Tester) RequireNotFoundReturned

func (t Tester) RequireNotFoundReturned(err error)

func (Tester) RequirePorter

func (t Tester) RequirePorter(args ...string) string

Run a porter command and fail the test if the command returns an error. Returns stdout.

func (Tester) RunPorter

func (t Tester) RunPorter(args ...string) (string, error)

Run a porter command returning stdout and stderr as an error if the command fails.

func (Tester) ShowInstallation

func (t Tester) ShowInstallation(namespace string, name string) (claims.Installation, error)

func (Tester) Teardown

func (t Tester) Teardown()

Jump to

Keyboard shortcuts

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