e2e

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

End-to-end test

Prerequisites

To run the end to end tests, you must have the following utilities installed on your test runner. The test script checks for the specific version referenced. While a package installer will install the utility, it may install a newer, or different version than the one specified. Be sure to install these versions.

Run End to End Tests

Set environment variables

export KBLD_E2E_DOCKERHUB_USERNAME=joeexample

To use a registry other than DockerHub, set the KBLD_E2E_DOCKERHUB_HOSTNAME variable. You can specify a local registry or use an anonymous service, such as ttl.sh. You will need to authenticate with non-anonymous registeries for the tests to pass.

# OPTIONAL
export KBLD_E2E_DOCKERHUB_HOSTNAME=ttl.sh

It is possible to specify the absolute path to the kbld binary that you wish to test with. This could be useful for testing a version installed by a package manager, or a previously built custom binary in non-standard location. This value defaults to the local binary.

# OPTIONAL
export KBLD_BINARY_PATH=/usr/local/bin/kbld

Run the end to end tests

$ ./hack/test-e2e.sh
$ ./hack/test-e2e.sh -run TestVersion

See ./test/e2e/env.go for required environment variables for some tests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	DockerHubUsername    string
	DockerHubHostname    string
	SkipStressTests      bool
	SkipWhenHTTPRegistry bool
	KbldBinaryPath       string
}

func BuildEnv

func BuildEnv(t *testing.T) Env

func (Env) Validate

func (e Env) Validate(t *testing.T)

func (Env) WithRegistries added in v0.7.0

func (e Env) WithRegistries(input string) string

type Kbld

type Kbld struct {
	// contains filtered or unexported fields
}

func (Kbld) Run

func (k Kbld) Run(args []string) string

func (Kbld) RunWithOpts

func (k Kbld) RunWithOpts(args []string, opts RunOpts) (string, error)

type Logger

type Logger struct{}

func (Logger) Debugf

func (l Logger) Debugf(msg string, args ...interface{})

func (Logger) Section

func (l Logger) Section(msg string, f func())

type RunOpts

type RunOpts struct {
	AllowError   bool
	StderrWriter io.Writer
	StdoutWriter io.Writer
	StdinReader  io.Reader
	CancelCh     chan struct{}
	Redact       bool
}

Jump to

Keyboard shortcuts

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