testrunner

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package testrunner exposes a way to interact with test_runner builds.

Index

Constants

This section is empty.

Variables

View Source
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 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 Build

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

Build represents an individual test_runner build.

func NewBuild

func NewBuild(ctx context.Context, c trservice.Client, argsGenerator ArgsGenerator) (*Build, error)

NewBuild creates a new test_runner build.

func NewBuildForTesting

func NewBuildForTesting(swarmingTaskID, url string) *Build

NewBuildForTesting allows other packages to create builds objects with arbitrary fields for testing.

func (*Build) Completed

func (b *Build) Completed() bool

Completed returns whether the current build is complete.

func (*Build) Refresh

func (b *Build) Refresh(ctx context.Context, c trservice.Client) error

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.

func (*Build) Retry

func (b *Build) Retry(ctx context.Context, c trservice.Client) (*Build, error)

Retry creates a new build to retry the current build.

Retry does not check whether the current build is complete.

func (*Build) TaskURL

func (b *Build) TaskURL() string

TaskURL returns the URL to the buildbucket build for this task.

Directories

Path Synopsis
Package service implements a skylab.Client using calls to BuildBucket.
Package service implements a skylab.Client using calls to BuildBucket.

Jump to

Keyboard shortcuts

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