test

package
v0.68.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 14 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.

func GetLogger added in v0.46.0

func GetLogger(t *testing.T) *slog.Logger

GetLogger returns the default log configuration for the tests.

Types

type ZarfE2ETest

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

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

func (*ZarfE2ETest) CleanFiles

func (e2e *ZarfE2ETest) CleanFiles(t *testing.T, files ...string)

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

func (*ZarfE2ETest) GetMismatchedArch

func (e2e *ZarfE2ETest) GetMismatchedArch() string

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

func (*ZarfE2ETest) GetZarfAtVersion added in v0.51.0

func (e2e *ZarfE2ETest) GetZarfAtVersion(t *testing.T, version string) string

GetZarfAtVersion pulls Zarf at a given version for the specific OS and architecture

func (*ZarfE2ETest) GetZarfVersion

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

GetZarfVersion returns the current build/zarf version

func (*ZarfE2ETest) Kubectl

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

Kubectl executes `zarf tools kubectl ...`

func (*ZarfE2ETest) Zarf

func (e2e *ZarfE2ETest) Zarf(t *testing.T, args ...string) (_ string, _ string, err error)

Zarf executes a Zarf command.

func (*ZarfE2ETest) ZarfInDir added in v0.42.1

func (e2e *ZarfE2ETest) ZarfInDir(t *testing.T, dir string, args ...string) (_ string, _ string, err error)

ZarfInDir executes a Zarf command in specific directory.

Directories

Path Synopsis
Package external provides a test for interacting with external resources
Package external provides a test for interacting with external resources
Package testutil provides global testing helper functions
Package testutil provides global testing helper functions

Jump to

Keyboard shortcuts

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