Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator interface { Logger() logrus.FieldLogger LogScope() *logger.LogScope ClientPool() *clients.ClientPool WalletManager() *wallet.Manager ValidatorNames() *names.ValidatorNames GlobalVariables() Variables LoadTests(ctx context.Context) AddTestDescriptor(testDescriptor TestDescriptor) error GetTestDescriptors() []TestDescriptor GetTestByRunID(runID uint64) Test GetTestQueue() []Test GetTestHistory() []Test ScheduleTest(descriptor TestDescriptor, configOverrides map[string]any, allowDuplicate bool) (Test, error) }
type ExternalTestConfig ¶ added in v0.0.4
type ExternalTestConfig struct { ID string `yaml:"id" json:"id"` File string `yaml:"file" json:"file"` Name string `yaml:"name" json:"name"` Timeout *helper.Duration `yaml:"timeout" json:"timeout"` Config map[string]interface{} `yaml:"config" json:"config"` ConfigVars map[string]string `yaml:"configVars" json:"configVars"` Schedule *TestSchedule `yaml:"schedule" json:"schedule"` }
type TaskContext ¶
type TaskContext struct { Scheduler TaskScheduler Index TaskIndex Vars Variables Outputs Variables Logger *logger.LogScope NewTask func(options *TaskOptions, variables Variables) (TaskIndex, error) SetResult func(result TaskResult) }
type TaskDescriptor ¶
type TaskDescriptor struct { Name string Aliases []string Description string Config interface{} NewTask func(ctx *TaskContext, options *TaskOptions) (Task, error) }
type TaskOptions ¶
type TaskOptions struct { // The name of the task to run. Name string `yaml:"name" json:"name"` // The configuration object of the task. Config *helper.RawMessage `yaml:"config" json:"config"` // The configuration settings to consume from runtime variables. ConfigVars map[string]string `yaml:"configVars" json:"configVars"` // The title of the task - this is used to describe the task to the user. Title string `yaml:"title" json:"title"` // Timeout defines the max time waiting for the condition to be met. Timeout helper.Duration `yaml:"timeout" json:"timeout"` // The optional id of the task (for result access via tasks.<task-id>). ID string `yaml:"id" json:"id"` // The optional condition to run the task. If string `yaml:"if" json:"if"` }
type TaskResult ¶
type TaskResult uint8
const ( TaskResultNone TaskResult = 0 TaskResultSuccess TaskResult = 1 TaskResultFailure TaskResult = 2 )
type TaskScheduler ¶
type TaskScheduler interface { GetServices() TaskServices ParseTaskOptions(rawtask *helper.RawMessage) (*TaskOptions, error) ExecuteTask(ctx context.Context, taskIndex TaskIndex, taskWatchFn func(ctx context.Context, cancelFn context.CancelFunc, taskIndex TaskIndex)) error WatchTaskPass(ctx context.Context, cancelFn context.CancelFunc, taskIndex TaskIndex) GetTaskState(taskIndex TaskIndex) TaskState GetTaskCount() int GetAllTasks() []TaskIndex GetRootTasks() []TaskIndex GetAllCleanupTasks() []TaskIndex GetRootCleanupTasks() []TaskIndex }
type TaskServices ¶ added in v0.0.3
type TaskServices interface { ClientPool() *clients.ClientPool WalletManager() *wallet.Manager ValidatorNames() *names.ValidatorNames }
type TaskState ¶ added in v0.0.10
type TaskState interface { Index() TaskIndex ParentIndex() TaskIndex ID() string Name() string Title() string Description() string Config() interface{} Timeout() time.Duration GetTaskStatus() *TaskStatus GetTaskStatusVars() Variables GetTaskVars() Variables GetTaskResultUpdateChan(oldResult TaskResult) <-chan bool }
type TaskStatus ¶
type Test ¶
type Test interface { Validate() error Run(ctx context.Context) error RunID() uint64 TestID() string Name() string StartTime() time.Time StopTime() time.Time Timeout() time.Duration Percent() float64 Status() TestStatus Logger() logrus.FieldLogger AbortTest(skipCleanup bool) GetTaskScheduler() TaskScheduler GetTestVariables() Variables }
type TestConfig ¶ added in v0.0.4
type TestConfig struct { ID string `yaml:"id" json:"id"` Name string `yaml:"name" json:"name"` Timeout helper.Duration `yaml:"timeout" json:"timeout"` Config map[string]interface{} `yaml:"config" json:"config"` ConfigVars map[string]string `yaml:"configVars" json:"configVars"` Tasks []helper.RawMessage `yaml:"tasks" json:"tasks"` CleanupTasks []helper.RawMessage `yaml:"cleanupTasks" json:"cleanupTasks"` Schedule *TestSchedule `yaml:"schedule" json:"schedule"` }
type TestDescriptor ¶ added in v0.0.4
type TestDescriptor interface { ID() string Source() string Config() *TestConfig Vars() Variables Err() error }
type TestSchedule ¶ added in v0.0.4
type TestStatus ¶
type TestStatus string
const ( TestStatusPending TestStatus = "pending" TestStatusRunning TestStatus = "running" TestStatusSuccess TestStatus = "success" TestStatusFailure TestStatus = "failure" TestStatusSkipped TestStatus = "skipped" TestStatusAborted TestStatus = "aborted" )
type Variables ¶
type Variables interface { GetVar(name string) interface{} LookupVar(name string) (interface{}, bool) ResolveQuery(query string) (interface{}, bool, error) SetVar(name string, value interface{}) SetDefaultVar(name string, value interface{}) GetSubScope(name string) Variables SetSubScope(name string, subScope Variables) NewScope() Variables GetVarsMap(varsMap map[string]any, skipParent bool) map[string]any ResolvePlaceholders(str string) string ConsumeVars(config interface{}, consumeMap map[string]string) error CopyVars(source Variables, copyMap map[string]string) error }
Click to show internal directories.
Click to hide internal directories.