Documentation
¶
Overview ¶
Package harness provides the main test harness functionality for KUTTL.
Index ¶
- type Harness
- func (h *Harness) Client(forceNew bool) (client.Client, error)
- func (h *Harness) Config() (*rest.Config, error)
- func (h *Harness) DiscoveryClient() (discovery.DiscoveryInterface, error)
- func (h *Harness) DockerClient() (testutils.DockerClient, error)
- func (h *Harness) GetLogger() testutils.Logger
- func (h *Harness) GetTimeout() int
- func (h *Harness) LoadTests(dir string) ([]*testcase.Case, error)
- func (h *Harness) NewSuiteReport(name string) *report.Testsuite
- func (h *Harness) Report()
- func (h *Harness) Run()
- func (h *Harness) RunKIND() (*rest.Config, error)
- func (h *Harness) RunTestEnv() (*rest.Config, error)
- func (h *Harness) RunTests()
- func (h *Harness) Setup()
- func (h *Harness) Stop()
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) Config ¶
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) GetTimeout ¶
GetTimeout returns the configured timeout for the test suite.
func (*Harness) NewSuiteReport ¶
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) RunTestEnv ¶
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.