Documentation ¶
Index ¶
- type AppUsage
- type Disposable
- type KubeTestPlatform
- func (c *KubeTestPlatform) AcquireAppExternalURL(name string) string
- func (c *KubeTestPlatform) GetAppHostDetails(name string) (string, string, error)
- func (c *KubeTestPlatform) GetAppUsage(appName string) (*AppUsage, error)
- func (c *KubeTestPlatform) GetSidecarUsage(appName string) (*AppUsage, error)
- func (c *KubeTestPlatform) GetTotalRestarts(appName string) (int, error)
- func (c *KubeTestPlatform) PortForwardToApp(appName string, targetPorts ...int) ([]int, error)
- func (c *KubeTestPlatform) Restart(name string) error
- func (c *KubeTestPlatform) Scale(name string, replicas int32) error
- func (c *KubeTestPlatform) SetAppEnv(name, key, value string) error
- type PlatformInterface
- type TestResources
- type TestRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Disposable ¶
Disposable is an interface representing the disposable test resources.
type KubeTestPlatform ¶
type KubeTestPlatform struct { AppResources *TestResources ComponentResources *TestResources KubeClient *kube.KubeClient }
KubeTestPlatform includes K8s client for testing cluster and kubernetes testing apps.
func NewKubeTestPlatform ¶
func NewKubeTestPlatform() *KubeTestPlatform
NewKubeTestPlatform creates KubeTestPlatform instance.
func (*KubeTestPlatform) AcquireAppExternalURL ¶
func (c *KubeTestPlatform) AcquireAppExternalURL(name string) string
AcquireAppExternalURL returns the external url for 'name'.
func (*KubeTestPlatform) GetAppHostDetails ¶ added in v0.8.0
func (c *KubeTestPlatform) GetAppHostDetails(name string) (string, string, error)
GetAppHostDetails returns the name and IP address of the host(pod) running 'name'.
func (*KubeTestPlatform) GetAppUsage ¶ added in v0.10.0
func (c *KubeTestPlatform) GetAppUsage(appName string) (*AppUsage, error)
GetAppUsage returns the Cpu and Memory usage for the app container for a given app.
func (*KubeTestPlatform) GetSidecarUsage ¶ added in v1.0.0
func (c *KubeTestPlatform) GetSidecarUsage(appName string) (*AppUsage, error)
GetSidecarUsage returns the Cpu and Memory usage for the dapr container for a given app.
func (*KubeTestPlatform) GetTotalRestarts ¶ added in v1.0.0
func (c *KubeTestPlatform) GetTotalRestarts(appName string) (int, error)
GetTotalRestarts returns the total of restarts across all pods and containers for an app.
func (*KubeTestPlatform) PortForwardToApp ¶ added in v0.8.0
func (c *KubeTestPlatform) PortForwardToApp(appName string, targetPorts ...int) ([]int, error)
PortForwardToApp opens a new connection to the app on a the target port and returns the local port or error.
func (*KubeTestPlatform) Restart ¶ added in v0.3.0
func (c *KubeTestPlatform) Restart(name string) error
Restart restarts all instances for the app.
func (*KubeTestPlatform) Scale ¶ added in v0.3.0
func (c *KubeTestPlatform) Scale(name string, replicas int32) error
Scale changes the number of replicas of the app.
func (*KubeTestPlatform) SetAppEnv ¶ added in v1.3.0
func (c *KubeTestPlatform) SetAppEnv(name, key, value string) error
SetAppEnv sets the container environment variable.
type PlatformInterface ¶
type PlatformInterface interface { AcquireAppExternalURL(name string) string GetAppHostDetails(name string) (string, string, error) Restart(name string) error Scale(name string, replicas int32) error PortForwardToApp(appName string, targetPort ...int) ([]int, error) SetAppEnv(appName, key, value string) error GetAppUsage(appName string) (*AppUsage, error) GetSidecarUsage(appName string) (*AppUsage, error) GetTotalRestarts(appname string) (int, error) // contains filtered or unexported methods }
PlatformInterface defines the testing platform for test runner.
type TestResources ¶
type TestResources struct {
// contains filtered or unexported fields
}
TestResources holds initial resources and active resources.
func (*TestResources) Add ¶
func (r *TestResources) Add(dr Disposable)
Add adds Disposable resource to resources queue.
func (*TestResources) FindActiveResource ¶
func (r *TestResources) FindActiveResource(name string) Disposable
FindActiveResource finds active resource by resource name.
type TestRunner ¶
type TestRunner struct { // Platform is the testing platform instances Platform PlatformInterface // contains filtered or unexported fields }
TestRunner holds initial test apps and testing platform instance maintains apps and platform for e2e test.
func NewTestRunner ¶
func NewTestRunner(id string, apps []kube.AppDescription, comps []kube.ComponentDescription, initApps []kube.AppDescription) *TestRunner
NewTestRunner returns TestRunner instance for e2e test.
func (*TestRunner) Start ¶
func (tr *TestRunner) Start(m runnable) int
Start is the entry point of Dapr test runner.