Documentation
¶
Overview ¶
Package runner contains code for a test runner that can run a list of load tests, wait for them to complete, and report on the results.
Package runner contains code for a test runner that can run a list of load tests, wait for them to complete, and report on the results.
Package runner contains code for a test runner that can run a list of load tests, wait for them to complete, and report on the results.
Package runner contains code for a test runner that can run a list of load tests, wait for them to complete, and report on the results.
Package runner contains code for a test runner that can run a list of load tests, wait for them to complete, and report on the results.
Index ¶
- func AfterIntervalFunction(d time.Duration) func()
- func CountConfigs(configMap map[string][]*grpcv1.LoadTest) map[string]int
- func CreateQueueMap(configs []*grpcv1.LoadTest, qs QueueSelectorFunction) map[string][]*grpcv1.LoadTest
- func DecodeFromFiles(fileNames []string) ([]*grpcv1.LoadTest, error)
- func LogPrefixFmt(configMap map[string][]*grpcv1.LoadTest) string
- func NewLoadTestGetter() clientset.LoadTestGetter
- func ValidateConcurrencyLevels(configMap map[string][]*grpcv1.LoadTest, concurrencyLevels map[string]int) error
- type ConcurrencyLevels
- type FileNames
- type QueueSelectorFunction
- type Runner
- type TestCaseReporter
- func (r *TestCaseReporter) Error(format string, v ...interface{})
- func (r *TestCaseReporter) Index() int
- func (r *TestCaseReporter) Info(format string, v ...interface{})
- func (r *TestCaseReporter) SetEndTime(endTime time.Time)
- func (r *TestCaseReporter) SetStartTime(startTime time.Time)
- func (r *TestCaseReporter) TestDuration() time.Duration
- func (r *TestCaseReporter) Warning(format string, v ...interface{})
- type TestSuiteReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterIntervalFunction ¶
AfterIntervalFunction returns a function that stops for a time interval. This function is provided so it can be replaced with a fake for testing.
func CountConfigs ¶
CountConfigs counts the number of configs in each queue.
func CreateQueueMap ¶
func CreateQueueMap(configs []*grpcv1.LoadTest, qs QueueSelectorFunction) map[string][]*grpcv1.LoadTest
CreateQueueMap maps LoadTest configurations into execution queues. Configurations are mapped into queues using a queue selector.
func DecodeFromFiles ¶
DecodeFromFiles reads LoadTest configurations from a set of files. Each file is a multipart YAML file containing LoadTest configurations.
func LogPrefixFmt ¶
LogPrefixFmt returns a string to format log line prefixes for each test. This string is used to format queue name and test index into a prefix.
func NewLoadTestGetter ¶
func NewLoadTestGetter() clientset.LoadTestGetter
NewLoadTestGetter returns a client to interact with LoadTest resources. The client can be used to create, query for status and delete LoadTests.
func ValidateConcurrencyLevels ¶
func ValidateConcurrencyLevels(configMap map[string][]*grpcv1.LoadTest, concurrencyLevels map[string]int) error
ValidateConcurrencyLevels checks that all queues have levels defined. LoadTests are mapped into queues and run concurrently. A concurrency level must be specified for each queue.
Types ¶
type ConcurrencyLevels ¶
ConcurrencyLevels defines an accumulator flag for concurrency levels. Concurrency levels are in the form [<queue name>:]<concurrency level>. These values are parsed and accumulated into a map.
func (*ConcurrencyLevels) Set ¶
func (c *ConcurrencyLevels) Set(value string) error
Set implements the flag.Value interface.
func (*ConcurrencyLevels) String ¶
func (c *ConcurrencyLevels) String() string
String implements the flag.Value interface.
type FileNames ¶
type FileNames []string
FileNames defines an accumulator flag for file names.
type QueueSelectorFunction ¶
QueueSelectorFunction maps a LoadTest configuration to an execution queue.
func QueueSelectorFromAnnotation ¶
func QueueSelectorFromAnnotation(key string) QueueSelectorFunction
QueueSelectorFromAnnotation sets up key selection from a config annotation. This function returns a queue selector function that looks for a specific key annotation and returns the value of the annotation.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner contains the information needed to run multiple sets of LoadTests.
type TestCaseReporter ¶
type TestCaseReporter struct {
// contains filtered or unexported fields
}
TestCaseReporter collects events for logging and reporting during a test.
func (*TestCaseReporter) Error ¶
func (r *TestCaseReporter) Error(format string, v ...interface{})
Error records an error message generated during the test. The error that caused the message to be generated is also included.
func (*TestCaseReporter) Index ¶
func (r *TestCaseReporter) Index() int
Index returns the index of the test case in the test suite (and queue).
func (*TestCaseReporter) Info ¶
func (r *TestCaseReporter) Info(format string, v ...interface{})
Info records an informational message generated by the test.
func (*TestCaseReporter) SetEndTime ¶
func (r *TestCaseReporter) SetEndTime(endTime time.Time)
SetEndTime records the end time of the test.
func (*TestCaseReporter) SetStartTime ¶
func (r *TestCaseReporter) SetStartTime(startTime time.Time)
SetStartTime records the start time of the test.
func (*TestCaseReporter) TestDuration ¶
func (r *TestCaseReporter) TestDuration() time.Duration
TestDuration returns the duration of the test.
func (*TestCaseReporter) Warning ¶
func (r *TestCaseReporter) Warning(format string, v ...interface{})
Warning records a warning message generated during the test. The error that caused the message to be generated is also included.
type TestSuiteReporter ¶
type TestSuiteReporter struct {
// contains filtered or unexported fields
}
TestSuiteReporter manages reports for tests that share a runner queue.
func NewTestSuiteReporter ¶
func NewTestSuiteReporter(qName string, logPrefixFmt string) *TestSuiteReporter
NewTestSuiteReporter creates a new suite reporter instance. TODO: Add a report to be filled in by the reporter.
func (*TestSuiteReporter) NewTestCaseReporter ¶
func (r *TestSuiteReporter) NewTestCaseReporter(config *grpcv1.LoadTest) *TestCaseReporter
NewTestCaseReporter creates a new reporter instance. TODO: Add a report to be filled in by the reporter.
func (*TestSuiteReporter) Queue ¶
func (r *TestSuiteReporter) Queue() string
Queue returns the name of the queue containing tests for this test suite.