Documentation
¶
Index ¶
- Constants
- func CheckIfResourceGroupInstalled(t *testing.T) bool
- func CheckKindClusterAvailable(t *testing.T) bool
- func CreateKindCluster(t *testing.T)
- func CreateNamespace(t *testing.T, namespace string)
- func InstallResourceGroup(t *testing.T)
- func RemoveKindCluster(t *testing.T)
- func RemoveNamespace(t *testing.T, namespace string)
- func RemoveResourceGroup(t *testing.T)
- type InventoryEntry
- type Runner
- func (r *Runner) Run(t *testing.T)
- func (r *Runner) RunApply(t *testing.T) (string, string, error)
- func (r *Runner) RunPreApply(t *testing.T)
- func (r *Runner) VerifyExitCode(t *testing.T, err error)
- func (r *Runner) VerifyInventory(t *testing.T, name, namespace string)
- func (r *Runner) VerifyStderr(t *testing.T, stderr string)
- func (r *Runner) VerifyStdout(t *testing.T, stdout string)
- type TestCaseConfig
Constants ¶
View Source
const ( KindClusterName = "live-e2e-test" K8sVersionEnvName = "K8S_VERSION" )
Variables ¶
This section is empty.
Functions ¶
func CreateKindCluster ¶
func CreateNamespace ¶
func InstallResourceGroup ¶
func RemoveKindCluster ¶
func RemoveNamespace ¶
func RemoveResourceGroup ¶
Types ¶
type InventoryEntry ¶
type InventoryEntry struct {
Group string `yaml:"group,omitempty"`
Kind string `yaml:"kind,omitempty"`
Name string `yaml:"name,omitempty"`
Namespace string `yaml:"namespace,omitempty"`
}
InventoryEntry defines an entry in an inventory list.
type Runner ¶
type Runner struct {
// Config provides the configuration for how this test should be
// executed.
Config TestCaseConfig
// Path provides the path to the test files.
Path string
}
Runner uses the provided Config to run a test.
func (*Runner) RunPreApply ¶
func (*Runner) VerifyInventory ¶
type TestCaseConfig ¶
type TestCaseConfig struct {
// ExitCode is the expected exit code from the kpt commands. Default: 0
ExitCode int `yaml:"exitCode,omitempty"`
// StdErr is the expected standard error output. Default: ""
StdErr string `yaml:"stdErr,omitempty"`
// StdOut is the expected standard output from running the command.
// Default: ""
StdOut string `yaml:"stdOut,omitempty"`
// Inventory is the expected list of resource present in the inventory.
Inventory []InventoryEntry `yaml:"inventory,omitempty"`
// NoResourceGroup defines whether the RG CRD should be present in the cluster
// when the test starts.
NoResourceGroup bool `yaml:"noResourceGroup,omitempty"`
// Parallel defines whether the test can be run in parallel with other
// tests. The primary requirement here is that the test doesn't create,
// update, or delete any cluster-scoped resources.
Parallel bool `yaml:"parallel,omitempty"`
// KptArgs is a list of args that will be provided to the kpt command
// when running the test.
KptArgs []string `yaml:"kptArgs,omitempty"`
}
func ReadTestCaseConfig ¶
func ReadTestCaseConfig(t *testing.T, path string) TestCaseConfig
Click to show internal directories.
Click to hide internal directories.