live

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindClusterName = "live-e2e-test"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InventoryEntry

type InventoryEntry struct {
	Group     string `yaml:"group,omitempty"`
	Kind      string `yaml:"kind,omitempty"`
	Name      string `yaml:"name,omitempty"`
	Namespace string `yaml:"namespace,omitempty"`
}

InventoryEntry defines an entry in an inventory list.

type Runner

type Runner struct {
	// Config provides the configuration for how this test should be
	// executed.
	Config TestCaseConfig

	// Path provides the path to the test files.
	Path string
}

Runner uses the provided Config to run a test.

func (*Runner) CheckForNamespace

func (r *Runner) CheckForNamespace(t *testing.T, namespace string) bool

func (*Runner) CheckIfResourceGroupInstalled

func (r *Runner) CheckIfResourceGroupInstalled(t *testing.T) bool

func (*Runner) CheckKindClusterAvailable

func (r *Runner) CheckKindClusterAvailable(t *testing.T) bool

func (*Runner) CreateKindCluster

func (r *Runner) CreateKindCluster(t *testing.T)

func (*Runner) CreateNamespace

func (r *Runner) CreateNamespace(t *testing.T, namespace string)

func (*Runner) InstallResourceGroup

func (r *Runner) InstallResourceGroup(t *testing.T)

func (*Runner) RemoveKindCluster

func (r *Runner) RemoveKindCluster(t *testing.T)

func (*Runner) RemoveNamespace

func (r *Runner) RemoveNamespace(t *testing.T, namespace string)

func (*Runner) Run

func (r *Runner) Run(t *testing.T)

Run executes the test.

func (*Runner) RunApply

func (r *Runner) RunApply() (string, string, error)

func (*Runner) RunPreApply

func (r *Runner) RunPreApply(t *testing.T)

func (*Runner) VerifyExitCode

func (r *Runner) VerifyExitCode(t *testing.T, err error)

func (*Runner) VerifyInventory

func (r *Runner) VerifyInventory(t *testing.T, name, namespace string)

func (*Runner) VerifyStderr

func (r *Runner) VerifyStderr(t *testing.T, stderr string)

func (*Runner) VerifyStdout

func (r *Runner) VerifyStdout(t *testing.T, stdout string)

type TestCaseConfig

type TestCaseConfig struct {
	// ExitCode is the expected exit code from the kpt commands. Default: 0
	ExitCode int `yaml:"exitCode,omitempty"`

	// StdErr is the expected standard error output. Default: ""
	StdErr string `yaml:"stdErr,omitempty"`

	// StdOut is the expected standard output from running the command.
	// Default: ""
	StdOut string `yaml:"stdOut,omitempty"`

	// Inventory is the expected list of resource present in the inventory.
	Inventory []InventoryEntry `yaml:"inventory,omitempty"`

	// RequiresCleanCluster tells the test framework that a new cluster must
	// be created for running this test.
	RequiresCleanCluster bool `yaml:"requiresCleanCluster,omitempty"`

	// PreinstallResourceGroup causes the test framework to verify that the
	// ResourceGroup CRD is available in the cluster before running the test.
	PreinstallResourceGroup bool `yaml:"preinstallResourceGroup,omitempty"`

	// KptArgs is a list of args that will be provided to the kpt command
	// when running the test.
	KptArgs []string `yaml:"kptArgs,omitempty"`
}

func ReadTestCaseConfig

func ReadTestCaseConfig(t *testing.T, path string) TestCaseConfig

Jump to

Keyboard shortcuts

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