porch

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestGitServerImage = "test-git-server"
)

Variables

This section is empty.

Functions

func GetGitServerImageName

func GetGitServerImageName(t *testing.T) string

func InferGitServerImage

func InferGitServerImage(porchImage string) string

func KubectlApply

func KubectlApply(t *testing.T, config string)

func KubectlCreateNamespace

func KubectlCreateNamespace(t *testing.T, name string)

func KubectlDeleteNamespace

func KubectlDeleteNamespace(t *testing.T, name string)

func KubectlWaitForDeployment

func KubectlWaitForDeployment(t *testing.T, namespace, name string)

func KubectlWaitForGitDNS

func KubectlWaitForGitDNS(t *testing.T, gitServerURL string)

Kubernetes DNS needs time to propagate the updated address Wait until we can register the repository and list its contents.

func KubectlWaitForService

func KubectlWaitForService(t *testing.T, namespace, name string)

func RegisterRepository

func RegisterRepository(t *testing.T, repoURL, namespace, name string)

func WriteTestCaseConfig

func WriteTestCaseConfig(t *testing.T, tc *TestCaseConfig)

Types

type Command

type Command struct {
	// Args is a list of args for the kpt CLI.
	Args []string `yaml:"args,omitempty"`
	// StdIn contents will be passed as the command's standard input, if not empty.
	Stdin string `yaml:"stdin,omitempty"`
	// StdOut is the standard output expected from the command.
	Stdout string `yaml:"stdout,omitempty"`
	// StdErr is the standard error output expected from the command.
	Stderr string `yaml:"stderr,omitempty"`
	// ExitCode is the expected exit code frm the command.
	ExitCode int `yaml:"exitCode,omitempty"`
	// Yaml indicates that stdout is yaml and the test will reformat it for stable ordering
	Yaml bool `yaml:"yaml,omitempty"`
}

type TestCaseConfig

type TestCaseConfig struct {
	// TestCase is the name of the test case.
	TestCase string `yaml:"-"`
	// ConfigFile stores the name of the config file from which the config was loaded.
	// Used when generating or updating golden files.
	ConfigFile string `yaml:"-"`
	// Repository is the name of the k8s Repository resource to register the default Git repo.
	Repository string `yaml:"repository,omitempty"`
	// Commands is a list of kpt commands to be executed by the test.
	Commands []Command `yaml:"commands,omitempty"`
	// Skip the test? If the value is not empty, it will be used as a message with which to skip the test.
	Skip string `yaml:"skip,omitempty"`
}

func ReadTestCaseConfig

func ReadTestCaseConfig(t *testing.T, name, path string) TestCaseConfig

Jump to

Keyboard shortcuts

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