Documentation
¶
Index ¶
- Variables
- type Engine
- func (e *Engine) BuilderByName(name string) (api.Builder, bool)
- func (e *Engine) Context() context.Context
- func (e *Engine) DoBuild(ctx context.Context, comp *api.Composition, output io.Writer) ([]*api.BuildOutput, error)
- func (e *Engine) DoCollectOutputs(ctx context.Context, runner string, runID string, w io.Writer) error
- func (e *Engine) DoHealthcheck(ctx context.Context, runner string, fix bool, w io.Writer) (*api.HealthcheckReport, error)
- func (e *Engine) DoRun(ctx context.Context, comp *api.Composition, output io.Writer) (*api.RunOutput, error)
- func (e *Engine) DoTerminate(ctx context.Context, runner string, w io.Writer) error
- func (e *Engine) EnvConfig() config.EnvConfig
- func (e *Engine) ListBuilders() map[string]api.Builder
- func (e *Engine) ListRunners() map[string]api.Runner
- func (e *Engine) RunnerByName(name string) (api.Runner, bool)
- func (e *Engine) TestCensus() api.TestCensus
- type EngineConfig
- type TestCensus
Constants ¶
This section is empty.
Variables ¶
var AllBuilders = []api.Builder{ &golang.DockerGoBuilder{}, &golang.ExecGoBuilder{}, }
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 ¶
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 NewEngine ¶
func NewEngine(cfg *EngineConfig) (*Engine, error)
func (*Engine) DoBuild ¶
func (e *Engine) DoBuild(ctx context.Context, comp *api.Composition, output io.Writer) ([]*api.BuildOutput, error)
func (*Engine) DoCollectOutputs ¶
func (*Engine) DoHealthcheck ¶ added in v0.2.0
func (*Engine) DoTerminate ¶ added in v0.2.0
func (*Engine) TestCensus ¶
func (e *Engine) TestCensus() api.TestCensus
type EngineConfig ¶
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.