runners

package
v1.3.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: 18 Imported by: 0

Documentation

Overview

This package contains helpers for configuring test runners that automate test setup/teardown. In general, every e2e test should at least have something like the following:

func TestMain(m *testing.M) {
	testenv = runners.NewRunner().Setup()
	os.Exit(testenv.Run(m))
}

The above code snippet will automatically bootstrap the cluster, install Cilium and Tetragon, port forward the necessary ports for gRPC and metrics, and register hooks to automatically clean up resources at the end of the test.

Index

Constants

View Source
const (
	ClusterPrefix = "tetragon-ci"
)

Variables

View Source
var DefaultRunner = Runner{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type PortForwardFunc

type PortForwardFunc func(env.Environment) env.Func

type Runner

type Runner struct {
	env.Environment
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) Init

func (r *Runner) Init() *Runner

Initialize the configured runner. Must be called exactly once.

func (*Runner) NoInstallCilium

func (r *Runner) NoInstallCilium() *Runner

func (*Runner) NoPortForward

func (r *Runner) NoPortForward() *Runner

func (*Runner) Run

func (r *Runner) Run(m *testing.M)

Run the tests. Exits with a corresponding status code. Must be called at the end of TestMain().

func (*Runner) SetupExport added in v0.10.0

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

Must be called at the beinning of every test.

func (*Runner) WithInstallCilium

func (r *Runner) WithInstallCilium(options ...cilium.Option) *Runner

func (*Runner) WithInstallCiliumFn

func (r *Runner) WithInstallCiliumFn(install env.Func) *Runner

func (*Runner) WithInstallTetragon

func (r *Runner) WithInstallTetragon(options ...tetragon.Option) *Runner

func (*Runner) WithInstallTetragonFn

func (r *Runner) WithInstallTetragonFn(install env.Func) *Runner

func (*Runner) WithKeepExportFiles

func (r *Runner) WithKeepExportFiles(keep bool) *Runner

func (*Runner) WithSetupClusterFn

func (r *Runner) WithSetupClusterFn(setup SetupClusterFunc) *Runner

type SetupClusterFunc

type SetupClusterFunc func(env.Environment) env.Func

Jump to

Keyboard shortcuts

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