Documentation
¶
Index ¶
- Constants
- Variables
- func CreateNamespace(namespace string) error
- func CurrentDir(t *testing.T) string
- func DeleteNamespace(namespace string) error
- func GetNextNamespaceId() int
- func GetNextServiceName(base string) string
- func NextNamespace() string
- func RunKubectl(namespace string, args ...string) (string, error)
- func WaitForNamespaceCreated(namespace string) error
- func WaitForNamespaceDeleted(namespace string) error
- type ClientFlags
- type Kn
- type KnRunResult
- type KnRunResultCollector
- func (c *KnRunResultCollector) AddDump(kind string, name string, namespace string)
- func (c *KnRunResultCollector) AssertError(result KnRunResult)
- func (c *KnRunResultCollector) AssertNoError(result KnRunResult)
- func (c *KnRunResultCollector) DumpIfFailed()
- func (c *KnRunResultCollector) KnTest() *KnTest
- func (c *KnRunResultCollector) T() *testing.T
- type KnTest
- type Kubectl
Constants ¶
Variables ¶
var Flags = InitializeFlags()
Flags holds the command line flags or defaults for settings in the user's environment. See ClientFlags for the list of supported fields.
Functions ¶
func CreateNamespace ¶
CreateNamespace creates and tests a namesspace creation invoking kubectl
func CurrentDir ¶
func DeleteNamespace ¶
DeleteNamespace deletes and tests a namesspace deletion invoking kubectl
func GetNextNamespaceId ¶
func GetNextNamespaceId() int
GetNextNamespaceId return the next unique ID for the next namespace
func GetNextServiceName ¶
GetNextServiceName return the name for the next namespace
func RunKubectl ¶
RunKubectl runs "kubectl" in a given namespace
func WaitForNamespaceCreated ¶
WaitForNamespaceCreated wait until namespace is created
func WaitForNamespaceDeleted ¶
WaitForNamespaceDeleted wait until namespace is deleted
Types ¶
type ClientFlags ¶
type ClientFlags struct {
DockerConfigJSON string
}
ClientFlags define the flags that are needed to run the e2e tests.
func InitializeFlags ¶
func InitializeFlags() *ClientFlags
InitializeFlags initializes the client's flags
type Kn ¶
type Kn struct {
// contains filtered or unexported fields
}
Kn type
func (Kn) RunNoNamespace ¶ added in v0.14.0
func (k Kn) RunNoNamespace(args ...string) KnRunResult
RunNoNamespace the 'kn' CLI with args but no namespace
type KnRunResult ¶
type KnRunResult struct {
// Command line called
CmdLine string
// Standard output of command
Stdout string
// Standard error of command
Stderr string
// And extra dump informations in case of an unexpected error
DumpInfo string
// Error occurred during execution
Error error
// Was an error expected ?
ErrorExpected bool
}
KnRunResult holds command and result artifacts of a "kn" call
func RunKn ¶
func RunKn(namespace string, args []string) KnRunResult
RunKn runs "kn" in a given namespace
type KnRunResultCollector ¶
type KnRunResultCollector struct {
// contains filtered or unexported fields
}
KnRunResultCollector collects Kn run's results
func NewKnRunResultCollector ¶
func NewKnRunResultCollector(t *testing.T, knTest *KnTest) *KnRunResultCollector
NewKnRunResultCollector returns a new KnRunResultCollector
func (*KnRunResultCollector) AddDump ¶
func (c *KnRunResultCollector) AddDump(kind string, name string, namespace string)
AddDump adds extra dump information to the collector which is printed out if an error occurs
func (*KnRunResultCollector) AssertError ¶
func (c *KnRunResultCollector) AssertError(result KnRunResult)
AssertError helper to assert error on result
func (*KnRunResultCollector) AssertNoError ¶
func (c *KnRunResultCollector) AssertNoError(result KnRunResult)
AssertNoError helper to assert no error on result
func (*KnRunResultCollector) DumpIfFailed ¶
func (c *KnRunResultCollector) DumpIfFailed()
DumpIfFailed logs if collector failed
func (*KnRunResultCollector) KnTest ¶ added in v0.14.0
func (c *KnRunResultCollector) KnTest() *KnTest
KnTest returns the KnTest object
func (*KnRunResultCollector) T ¶ added in v0.14.0
func (c *KnRunResultCollector) T() *testing.T
T returns the *testing.T object