test

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 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
}

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) GetLogFileContents

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

func (e2e *ZarfE2ETest) GetMismatchedArch() string

GetMismatchedArch determines what architecture our tests are running on, and returns the opposite 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) NormalizeYAMLFilenames

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

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

func (*ZarfE2ETest) StripMessageFormatting

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

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

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