test

package
v1.2.47 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandArgFileName      = "command_args.yml"
	CommandArgDirectoryName = "command_args"
)

Variables

View Source
var (
	MockClusterID   = "24vf9iitg3p6tlml88iml6j6mu095mh8"
	MockClusterHREF = "/api/clusters_mgmt/v1/clusters/24vf9iitg3p6tlml88iml6j6mu095mh8"
	MockClusterName = "cluster"
)

Functions

func BuildBreakGlassCredential added in v1.2.38

func BuildBreakGlassCredential() *v1.BreakGlassCredential

func BuildExternalAuth added in v1.2.37

func BuildExternalAuth() *v1.ExternalAuth

func FormatAccessRequestList added in v1.2.47

func FormatAccessRequestList(accessRequests []*accessv1.AccessRequest) string

func FormatClusterList added in v1.2.26

func FormatClusterList(clusters []*v1.Cluster) string

func FormatExternalAuthList added in v1.2.37

func FormatExternalAuthList(externalAuths []*v1.ExternalAuth) string

func FormatHtpasswdUserList added in v1.2.37

func FormatHtpasswdUserList(htpasswdUsers []*v1.HTPasswdUser) string

func FormatIDPList added in v1.2.37

func FormatIDPList(idps []*v1.IdentityProvider) string

func FormatIngressList added in v1.2.27

func FormatIngressList(ingresses []*v1.Ingress) string

func FormatKubeletConfigList added in v1.2.40

func FormatKubeletConfigList(configs []*v1.KubeletConfig) string

func FormatList added in v1.2.45

func FormatList[T any](list []*T, marshalFunc func([]*T, io.Writer) error, kind string) string

func FormatMachinePoolList added in v1.2.43

func FormatMachinePoolList(machinePools []*v1.MachinePool) string

Example usage for MachinePool and NodePool

func FormatMachineTypeList added in v1.2.45

func FormatMachineTypeList(mt []*v1.MachineType) string

func FormatNodePoolAutoscaling added in v1.2.43

func FormatNodePoolAutoscaling(nodePoolId string) string

FormatNodePoolAutoscaling simulates the output of APIs for a fake node pool list with autoscaling

func FormatNodePoolList added in v1.2.40

func FormatNodePoolList(nodePools []*v1.NodePool) string

func FormatNodePoolUpgradePolicyList added in v1.2.27

func FormatNodePoolUpgradePolicyList(upgrades []*v1.NodePoolUpgradePolicy) string

func FormatQuotaCostList added in v1.2.45

func FormatQuotaCostList(qc []*amsv1.QuotaCost) string

func FormatResource added in v1.2.29

func FormatResource(resource interface{}) string

FormatResource wraps the SDK marshalling and returns a string starting from an object

func FormatTuningConfigList added in v1.2.45

func FormatTuningConfigList(tc []*v1.TuningConfig) string

func FormatVersionList added in v1.2.35

func FormatVersionList(versions []*v1.Version) string

func GetCommandArgsFile added in v1.2.43

func GetCommandArgsFile(commandStructureDir string, command *cobra.Command) string

func MockAutoscaler added in v1.2.38

func MockAutoscaler(modifyFn func(a *v1.ClusterAutoscalerBuilder)) *v1.ClusterAutoscaler

func MockCluster added in v1.2.38

func MockCluster(modifyFn func(c *v1.ClusterBuilder)) *v1.Cluster

func MockKubeletConfig added in v1.2.40

func MockKubeletConfig(modifyFn func(k *v1.KubeletConfigBuilder)) *v1.KubeletConfig

func MockNodePool added in v1.2.40

func MockNodePool(modifyFn func(n *v1.NodePoolBuilder)) *v1.NodePool

func RunWithOutputCapture

func RunWithOutputCapture(runWithRuntime func(*rosa.Runtime, *cobra.Command) error,
	runtime *rosa.Runtime, cmd *cobra.Command) (string, string, error)

func RunWithOutputCaptureAndArgv added in v1.2.26

func RunWithOutputCaptureAndArgv(runWithRuntime func(*rosa.Runtime, *cobra.Command, []string) error,
	runtime *rosa.Runtime, cmd *cobra.Command, argv *[]string) (string, string, error)

Types

type ArgGenerator added in v1.2.43

type ArgGenerator struct {
	// contains filtered or unexported fields
}

func NewArgGenerator added in v1.2.43

func NewArgGenerator(argFile string, command *cobra.Command) *ArgGenerator

func (*ArgGenerator) GenerateArgsFile added in v1.2.43

func (a *ArgGenerator) GenerateArgsFile()

type ArgVerifier added in v1.2.43

type ArgVerifier struct {
	Args    map[string]*rosaCommandArg
	Command *cobra.Command
}

func NewArgVerifier added in v1.2.43

func NewArgVerifier(commandStructureDir string, command *cobra.Command) *ArgVerifier

func (*ArgVerifier) AssertCommandArgs added in v1.2.43

func (a *ArgVerifier) AssertCommandArgs()

type StructureVerifier added in v1.2.43

type StructureVerifier struct {
	// contains filtered or unexported fields
}

func NewStructureVerifier added in v1.2.43

func NewStructureVerifier(commandStructureDirectory string, rootCommand *cobra.Command) *StructureVerifier

func (*StructureVerifier) AssertCommandStructure added in v1.2.43

func (s *StructureVerifier) AssertCommandStructure()

type TestingRuntime added in v1.2.26

type TestingRuntime struct {
	SsoServer    *ghttp.Server
	ApiServer    *ghttp.Server
	RosaRuntime  *rosa.Runtime
	StdOutReader stdOutReader
}

TestingRuntime is a wrapper for the structure used for testing

func NewTestRuntime added in v1.2.38

func NewTestRuntime() *TestingRuntime

func (*TestingRuntime) Close added in v1.2.38

func (t *TestingRuntime) Close()

func (*TestingRuntime) InitRuntime added in v1.2.26

func (t *TestingRuntime) InitRuntime()

func (*TestingRuntime) SetCluster added in v1.2.38

func (t *TestingRuntime) SetCluster(clusterKey string, cluster *v1.Cluster)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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