Documentation
¶
Overview ¶
Package testrunner exposes a way to interact with test_runner builds.
Index ¶
- Variables
- func ValidateDependencies(ctx context.Context, c trservice.Client, argsGenerator ArgsGenerator) ([]types.TaskDimKeyVal, error)
- type ArgsGenerator
- type ArgsModifier
- type Build
- func (b *Build) Completed() bool
- func (b *Build) Refresh(ctx context.Context, c trservice.Client) error
- func (b *Build) Result() *steps.ExecuteResponse_TaskResult
- func (b *Build) Retry(ctx context.Context, c trservice.Client, retryNumber int32) (*Build, error)
- func (b *Build) Running() bool
- func (b *Build) TaskURL() string
Constants ¶
This section is empty.
Variables ¶
var InvalidDependencies = errors.BoolTag{Key: errors.NewTagKey("invalid test dependencies")}
InvalidDependencies tag indicates that an error was caused because swarming dependencies for a task were invalid.
Functions ¶
func ValidateDependencies ¶
func ValidateDependencies(ctx context.Context, c trservice.Client, argsGenerator ArgsGenerator) ([]types.TaskDimKeyVal, error)
ValidateDependencies checks whether this test has dependencies satisfied by VMLab or at least one Skylab bot.
Returns nil if the dependencies are valid and satisfiable. Returns an error tagged with InvalidDependencies tag if provided dependencies are invalid. Optionally returns a map of the unsatisfiable dependencies.
Errors encountered in dependency validation are returned as generic errors.
Types ¶
type ArgsGenerator ¶
type ArgsGenerator interface { // Generate arguments for swarming task or buildbucket build. GenerateArgs(ctx context.Context) (request.Args, error) // Check the internal consistency of of the generator arguments. CheckConsistency() error }
ArgsGenerator is used to generate arguments to buildbucket / swarming.
type ArgsModifier ¶
ArgsModifier is used to inject modifications to
type Build ¶
type Build struct { Args request.Args TaskReference trservice.TaskReference // contains filtered or unexported fields }
Build represents an individual test_runner build.
func NewBuild ¶
func NewBuild(ctx context.Context, c trservice.Client, argsGenerator ArgsGenerator, argsModifier ArgsModifier) (*Build, error)
NewBuild creates a new test_runner build.
func NewBuildForTesting ¶
NewBuildForTesting allows other packages to create builds objects with arbitrary fields for testing.
func (*Build) Refresh ¶
Refresh fetches and updates the state of the given build from the test_runner service.
func (*Build) Result ¶
func (b *Build) Result() *steps.ExecuteResponse_TaskResult
Result constructs a TaskResults out of the last known state of the Build.
In order to get the latest result, FetchResult needs to be called first.