runner

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppUsage added in v0.10.0

type AppUsage struct {
	CPU    string
	Memory string
}

type Disposable

type Disposable interface {
	Name() string
	Init() error
	Dispose() error
}

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 dapr container for a given 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

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)
	GetAppUsage(appName string) (*AppUsage, 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

Jump to

Keyboard shortcuts

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