framework

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 16 Imported by: ? modules, 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

Overview

Package framework is a package helping setting up end-to-end testing across a Kubernetes cluster.

Index

Constants

View Source
const (
	AutoCleanupLabelKey   = "stable.agones.dev/e2e-test-auto-cleanup"
	AutoCleanupLabelValue = "true"
)

special labels that can be put on pods to trigger automatic cleanup.

Variables

This section is empty.

Functions

func FleetReadyCount added in v0.5.0

func FleetReadyCount(amount int32) func(fleet *v1alpha1.Fleet) bool

FleetReadyCount returns the ready count in a fleet

func PingGameServer

func PingGameServer(msg, address string) (reply string, err error)

PingGameServer pings a gameserver and returns its reply

Types

type Framework

type Framework struct {
	KubeClient      kubernetes.Interface
	AgonesClient    versioned.Interface
	GameServerImage string
	PullSecret      string
	StressTestLevel int
}

Framework is a testing framework

func New

func New(kubeconfig, gsimage string, pullSecret string, stressTestLevel int) (*Framework, error)

New setups a testing framework using a kubeconfig path and the game server image to use for testing.

func (*Framework) CleanUp

func (f *Framework) CleanUp(ns string) error

CleanUp Delete all Agones resources in a given namespace.

func (*Framework) CreateGameServerAndWaitUntilReady

func (f *Framework) CreateGameServerAndWaitUntilReady(ns string, gs *v1alpha1.GameServer) (*v1alpha1.GameServer, error)

CreateGameServerAndWaitUntilReady Creates a GameServer and wait for its state to become ready.

func (*Framework) ListGameServersFromFleet added in v0.5.0

func (f *Framework) ListGameServersFromFleet(flt *v1alpha1.Fleet) ([]v1alpha1.GameServer, error)

ListGameServersFromFleet lists GameServers from a particular fleet

func (*Framework) WaitForFleetCondition added in v0.5.0

func (f *Framework) WaitForFleetCondition(t *testing.T, flt *v1alpha1.Fleet, condition func(fleet *v1alpha1.Fleet) bool)

WaitForFleetCondition waits for the Fleet to be in a specific condition or fails the test if the condition can't be met in 5 minutes.

func (*Framework) WaitForFleetGameServersCondition added in v0.5.0

func (f *Framework) WaitForFleetGameServersCondition(flt *v1alpha1.Fleet, cond func(server v1alpha1.GameServer) bool) error

WaitForFleetGameServersCondition wait for all GameServers for a given fleet to match the spec.replicas and match a a condition

func (*Framework) WaitForGameServerState

func (f *Framework) WaitForGameServerState(gs *v1alpha1.GameServer, state v1alpha1.GameServerState,
	timeout time.Duration) (*v1alpha1.GameServer, error)

WaitForGameServerState Waits untils the gameserver reach a given state before the timeout expires

type PerfResults added in v0.8.0

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

PerfResults aggregates performance test results. The AddSample() method is safe for concurrent use by multiple goroutines.

func (*PerfResults) AddSample added in v0.8.0

func (p *PerfResults) AddSample(d time.Duration)

AddSample adds a single time measurement.

func (*PerfResults) Report added in v0.8.0

func (p *PerfResults) Report(name string)

Report outputs performance report to log.

Jump to

Keyboard shortcuts

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