test

package
v0.33.1 Latest Latest
Warning

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

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

Documentation

Overview

Package test provides e2e tests for Zarf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCLIName

func GetCLIName() string

GetCLIName looks at the OS and CPU architecture to determine which Zarf binary needs to be run.

Types

type ZarfE2ETest

type ZarfE2ETest struct {
	ZarfBinPath       string
	Arch              string
	ApplianceMode     bool
	ApplianceModeKeep bool
	RunClusterTests   bool
}

ZarfE2ETest Struct holding common fields most of the tests will utilize.

func (*ZarfE2ETest) CleanFiles

func (e2e *ZarfE2ETest) CleanFiles(files ...string)

CleanFiles removes files and directories that have been created during the test.

func (*ZarfE2ETest) GetLogFileContents added in v0.26.3

func (e2e *ZarfE2ETest) GetLogFileContents(t *testing.T, stdErr string) string

GetLogFileContents gets the log file contents from a given run's std error.

func (*ZarfE2ETest) GetMismatchedArch added in v0.26.3

func (e2e *ZarfE2ETest) GetMismatchedArch() string

GetMismatchedArch determines what architecture our tests are running on, and returns the opposite architecture.

func (*ZarfE2ETest) GetZarfVersion added in v0.28.1

func (e2e *ZarfE2ETest) GetZarfVersion(t *testing.T) string

GetZarfVersion returns the current build/zarf version

func (*ZarfE2ETest) Kubectl added in v0.27.1

func (e2e *ZarfE2ETest) Kubectl(args ...string) (string, string, error)

Kubectl executes `zarf tools kubectl ...`

func (*ZarfE2ETest) NormalizeYAMLFilenames added in v0.31.1

func (e2e *ZarfE2ETest) NormalizeYAMLFilenames(input string) string

NormalizeYAMLFilenames normalizes YAML filenames / paths across Operating Systems (i.e Windows vs Linux)

func (*ZarfE2ETest) SetupDockerRegistry added in v0.27.0

func (e2e *ZarfE2ETest) SetupDockerRegistry(t *testing.T, port int)

SetupDockerRegistry uses the host machine's docker daemon to spin up a local registry for testing purposes.

func (*ZarfE2ETest) SetupWithCluster

func (e2e *ZarfE2ETest) SetupWithCluster(t *testing.T)

SetupWithCluster performs actions for each test that requires a K8s cluster.

func (*ZarfE2ETest) StripMessageFormatting added in v0.31.4

func (e2e *ZarfE2ETest) StripMessageFormatting(input string) string

StripMessageFormatting strips any ANSI color codes and extra spaces from a given string

func (*ZarfE2ETest) TeardownRegistry added in v0.29.0

func (e2e *ZarfE2ETest) TeardownRegistry(t *testing.T, port int)

TeardownRegistry removes the local registry.

func (*ZarfE2ETest) Zarf added in v0.27.1

func (e2e *ZarfE2ETest) Zarf(args ...string) (string, string, error)

Zarf executes a Zarf command.

Directories

Path Synopsis
Package external provides a test for interacting with external resources
Package external provides a test for interacting with external resources
Package mocks contains all the mocks used in Zarf tests.
Package mocks contains all the mocks used in Zarf tests.

Jump to

Keyboard shortcuts

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