harness

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package harness provides the main test harness functionality for KUTTL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Harness

type Harness struct {
	TestSuite    harness.TestSuite
	T            *testing.T
	RunLabels    labels.Set
	TemplateVars map[string]any
	// contains filtered or unexported fields
}

Harness loads and runs tests based on the configuration provided.

func (*Harness) Client

func (h *Harness) Client(forceNew bool) (client.Client, error)

Client returns the current Kubernetes client for the test harness.

func (*Harness) Config

func (h *Harness) Config() (*rest.Config, error)

Config returns the current Kubernetes configuration - either from the environment or from the created temporary control plane. As a side effect, on first successful call this method also writes a kubernetes client config file in YAML format to a file called "kubeconfig" in the current directory.

func (*Harness) DiscoveryClient

func (h *Harness) DiscoveryClient() (discovery.DiscoveryInterface, error)

DiscoveryClient returns the current Kubernetes discovery client for the test harness.

func (*Harness) DockerClient

func (h *Harness) DockerClient() (testutils.DockerClient, error)

DockerClient returns the Docker client to use for the test harness.

func (*Harness) GetLogger

func (h *Harness) GetLogger() testutils.Logger

GetLogger returns an initialized test logger.

func (*Harness) GetTimeout

func (h *Harness) GetTimeout() int

GetTimeout returns the configured timeout for the test suite.

func (*Harness) LoadTests

func (h *Harness) LoadTests(dir string) ([]*testcase.Case, error)

LoadTests loads all of the tests in a given directory.

func (*Harness) NewSuiteReport

func (h *Harness) NewSuiteReport(name string) *report.Testsuite

NewSuiteReport creates and assigns a TestSuite to the TestSuites (then returns the suite).

func (*Harness) Report

func (h *Harness) Report()

Report defines the report phase of the kuttl tests. If report format is nil it is skipped. otherwise it will provide a json or xml format report of tests in a junit format.

func (*Harness) Run

func (h *Harness) Run()

Run the test harness - start the control plane and then run the tests.

func (*Harness) RunKIND

func (h *Harness) RunKIND() (*rest.Config, error)

RunKIND starts a KIND cluster.

func (*Harness) RunTestEnv

func (h *Harness) RunTestEnv() (*rest.Config, error)

RunTestEnv starts a Kubernetes API server and etcd server for use in the tests and returns the Kubernetes configuration.

func (*Harness) RunTests

func (h *Harness) RunTests()

RunTests should be called from within a Go test (t) and launches all of the KUTTL integration tests at dir.

func (*Harness) Setup

func (h *Harness) Setup()

Setup spins up the test env based on configuration It can be used to start env which can than be modified prior to running tests, otherwise use Run().

func (*Harness) Stop

func (h *Harness) Stop()

Stop the test environment and clean up the harness.

Jump to

Keyboard shortcuts

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