e2e

package
v0.0.0-...-84fd5d0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputFilePath = "/file.yaml"
)

Variables

This section is empty.

Functions

func AppendFromFileCommonArgs

func AppendFromFileCommonArgs(args ...string) []string

func CommonExcludedFileArgs

func CommonExcludedFileArgs() []string

func MustMarshal

func MustMarshal(t *testing.T, d any) []byte

func MustMarshalToMultiYAML

func MustMarshalToMultiYAML(t *testing.T, data ...any) []byte

func TimeBubbleStartTime

func TimeBubbleStartTime() time.Time

Types

type NewRootCmdFunc

type NewRootCmdFunc func() (rootCmd *cobra.Command, out *bytes.Buffer)

NewRootCmdFunc returns the root command for the cli and an output buffer which returns the output after command execution

func NewRootCmd

func NewRootCmd(t *testing.T, c *TestConfig) NewRootCmdFunc

type Test

type Test[Response, RawObject any] struct {
	Name string

	NewRootCmd NewRootCmdFunc
	CmdArgs    []string
	Out        *bytes.Buffer

	AssertExhaustiveArgs     bool
	AssertExhaustiveExcludes []string

	// output format tests
	WantObject      RawObject     // for rawyaml / rawjson printer
	WantProtoObject proto.Message // for yaml / json printer
	WantTable       *string       // for table printer
	WantWideTable   *string       // for wide table printer
	WantMarkdown    *string       // for markdown printer
	WantTemplate    *string       // for template printer
	Template        *string       // for template printer

	WantErr error
}

func (*Test[Response, RawObject]) TestCmd

func (c *Test[Response, RawObject]) TestCmd(t *testing.T)

type TestConfig

type TestConfig struct {
	FsMocks     func(fs *afero.Afero)
	MockStdin   *bytes.Buffer
	ClientCalls []client.ClientCall
}

Jump to

Keyboard shortcuts

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