engine

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AllBuilders enumerates all builders known to the system.

AllRunners enumerates all runners known to the system.

Functions

This section is empty.

Types

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 queriable, 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 NewDefaultEngine

func NewDefaultEngine() (*Engine, error)

func NewEngine

func NewEngine(cfg *EngineConfig) (*Engine, error)

func (*Engine) BuilderByName

func (e *Engine) BuilderByName(name string) (api.Builder, bool)

func (*Engine) Context

func (e *Engine) Context() context.Context

func (*Engine) DoBuild

func (e *Engine) DoBuild(ctx context.Context, comp *api.Composition, output io.Writer) ([]*api.BuildOutput, error)

func (*Engine) DoCollectOutputs

func (e *Engine) DoCollectOutputs(ctx context.Context, runner string, runID string, w io.Writer) error

func (*Engine) DoHealthcheck added in v0.2.0

func (e *Engine) DoHealthcheck(ctx context.Context, runner string, fix bool, w io.Writer) (*api.HealthcheckReport, error)

func (*Engine) DoRun

func (e *Engine) DoRun(ctx context.Context, comp *api.Composition, output io.Writer) (*api.RunOutput, error)

func (*Engine) DoTerminate added in v0.2.0

func (e *Engine) DoTerminate(ctx context.Context, runner string, w io.Writer) error

func (*Engine) EnvConfig

func (e *Engine) EnvConfig() config.EnvConfig

EnvConfig returns the EnvConfig for this Engine.

func (*Engine) ListBuilders

func (e *Engine) ListBuilders() map[string]api.Builder

func (*Engine) ListRunners

func (e *Engine) ListRunners() map[string]api.Runner

func (*Engine) RunnerByName

func (e *Engine) RunnerByName(name string) (api.Runner, bool)

func (*Engine) TestCensus

func (e *Engine) TestCensus() api.TestCensus

type EngineConfig

type EngineConfig struct {
	Builders  []api.Builder
	Runners   []api.Runner
	EnvConfig *config.EnvConfig
}

type TestCensus

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

TestCensus represents a test census. It is a singleton object managed by this package, and should not be instantiated explicitly, unless for testing purposes.

func (*TestCensus) EnrollTestPlan

func (c *TestCensus) EnrollTestPlan(tp *api.TestPlanDefinition) error

EnrollTestPlan registers this test plan in the census.

func (*TestCensus) ListPlans

func (c *TestCensus) ListPlans() (tp []*api.TestPlanDefinition)

List returns all test plans enrolled.

func (*TestCensus) PlanByName

func (c *TestCensus) PlanByName(name string) *api.TestPlanDefinition

ByName returns the test plan with the specified name, or nil if inexistent.

Jump to

Keyboard shortcuts

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