Documentation ¶
Index ¶
- Variables
- func UnmarshalTask(taskData []byte) (*task.Task, error)
- type BuildInput
- type Engine
- func (e *Engine) BuilderByName(name string) (api.Builder, bool)
- func (e *Engine) Context() context.Context
- func (e *Engine) DeleteTask(id string) error
- func (e *Engine) DoBuildPurge(ctx context.Context, builder, plan string, ow *rpc.OutputWriter) error
- func (e *Engine) DoCollectOutputs(ctx context.Context, runID string, ow *rpc.OutputWriter) error
- func (e *Engine) DoHealthcheck(ctx context.Context, runner string, fix bool, ow *rpc.OutputWriter) (*api.HealthcheckReport, error)
- func (e *Engine) DoTerminate(ctx context.Context, ctype api.ComponentType, ref string, ow *rpc.OutputWriter) error
- func (e *Engine) EnvConfig() config.EnvConfig
- func (e *Engine) GetTask(id string) (*task.Task, error)
- func (e *Engine) Kill(id string) error
- func (e *Engine) ListBuilders() map[string]api.Builder
- func (e *Engine) ListRunners() map[string]api.Runner
- func (e *Engine) Logs(ctx context.Context, id string, follow bool, cancel bool, w io.Writer) (*task.Task, error)
- func (e *Engine) QueueBuild(request *api.BuildRequest, sources *api.UnpackedSources) (string, error)
- func (e *Engine) QueueRun(request *api.RunRequest, sources *api.UnpackedSources) (string, error)
- func (e *Engine) RunnerByName(name string) (api.Runner, bool)
- func (e *Engine) Tasks(filters api.TasksFilters) ([]task.Task, error)
- type EngineConfig
- type RunInput
- type TaskExecutionError
Constants ¶
This section is empty.
Variables ¶
var AllBuilders = []api.Builder{ &build.DockerGoBuilder{}, &build.ExecGoBuilder{}, &build.DockerGenericBuilder{}, &build.DockerNodeBuilder{}, }
AllBuilders enumerates all builders known to the system.
var AllRunners = []api.Runner{ &runner.LocalDockerRunner{}, &runner.LocalExecutableRunner{}, &runner.ClusterSwarmRunner{}, &runner.ClusterK8sRunner{}, }
AllRunners enumerates all runners known to the system.
Functions ¶
Types ¶
type BuildInput ¶ added in v0.6.0
type BuildInput struct { *api.BuildRequest Sources *api.UnpackedSources }
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the central runtime object of the system. It knows about all test plans, builders, and runners. It is supposed to be instantiated as a singleton in all runtimes, whether the testground is run as a CLI tool, or as a daemon. In the latter mode, the GitHub bridge will trigger commands and perform queries on the Engine.
TODO: the Engine should also centralise all system state and make it queryable, e.g. what tests are running, or have run, such that we can easily query test plans that ran for a particular commit of an upstream.
func NewEngine ¶
func NewEngine(cfg *EngineConfig) (*Engine, error)
func (*Engine) DeleteTask ¶ added in v0.6.0
DeleteTask removes a task from the Testground daemon database
func (*Engine) DoBuildPurge ¶ added in v0.5.3
func (*Engine) DoCollectOutputs ¶
func (*Engine) DoHealthcheck ¶
func (e *Engine) DoHealthcheck(ctx context.Context, runner string, fix bool, ow *rpc.OutputWriter) (*api.HealthcheckReport, error)
func (*Engine) DoTerminate ¶
func (e *Engine) DoTerminate(ctx context.Context, ctype api.ComponentType, ref string, ow *rpc.OutputWriter) error
func (*Engine) Kill ¶ added in v0.6.0
Kill closes the signal channel for a given task, which signals to the runner to stop it
func (*Engine) Logs ¶ added in v0.6.0
func (e *Engine) Logs(ctx context.Context, id string, follow bool, cancel bool, w io.Writer) (*task.Task, error)
Logs writes the Testground daemon logs for a given task to the passed writer. It is used when using the `--follow` option with `testground run`
func (*Engine) QueueBuild ¶ added in v0.6.0
func (e *Engine) QueueBuild(request *api.BuildRequest, sources *api.UnpackedSources) (string, error)
func (*Engine) QueueRun ¶ added in v0.6.0
func (e *Engine) QueueRun(request *api.RunRequest, sources *api.UnpackedSources) (string, error)
type EngineConfig ¶
type RunInput ¶ added in v0.6.0
type RunInput struct { *api.RunRequest Sources *api.UnpackedSources }
type TaskExecutionError ¶ added in v0.6.0
func (*TaskExecutionError) Error ¶ added in v0.6.0
func (e *TaskExecutionError) Error() string