Documentation ¶
Overview ¶
Package runnerclient provides a client interface to tast test runners.
Index ¶
- type Client
- func (c *Client) CollectSysInfo(ctx context.Context, req *protocol.CollectSysInfoRequest) (res *protocol.CollectSysInfoResponse, retErr error)
- func (c *Client) DownloadPrivateBundles(ctx context.Context, req *protocol.DownloadPrivateBundlesRequest) (retErr error)
- func (c *Client) GetDUTInfo(ctx context.Context, req *protocol.GetDUTInfoRequest) (res *protocol.GetDUTInfoResponse, retErr error)
- func (c *Client) GetSysInfoState(ctx context.Context, req *protocol.GetSysInfoStateRequest) (res *protocol.GetSysInfoStateResponse, retErr error)
- func (c *Client) GlobalRuntimeVars(ctx context.Context) (vars []string, retErr error)
- func (c *Client) ListFixtures(ctx context.Context) (fixtures []*drivercore.BundleEntity, retErr error)
- func (c *Client) ListTests(ctx context.Context, patterns []string, features *protocol.Features) (tests []*drivercore.BundleEntity, retErr error)
- func (c *Client) RunTests(ctx context.Context, bcfg *protocol.BundleConfig, rcfg *protocol.RunConfig, ...)
- func (c *Client) StreamFile(ctx context.Context, src, dest string, offset int64) (nextOffset int64, err error)
- type RunTestsOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GRPC-protocol client to test_runner.
func New ¶
func New(cmd genericexec.Cmd, params *protocol.RunnerInitParams, msgTimeout time.Duration, hops int) *Client
New creates a new Client.
func (*Client) CollectSysInfo ¶
func (c *Client) CollectSysInfo(ctx context.Context, req *protocol.CollectSysInfoRequest) (res *protocol.CollectSysInfoResponse, retErr error)
CollectSysInfo collects the sysinfo, considering diff from the given initial sysinfo state.
func (*Client) DownloadPrivateBundles ¶
func (c *Client) DownloadPrivateBundles(ctx context.Context, req *protocol.DownloadPrivateBundlesRequest) (retErr error)
DownloadPrivateBundles downloads and installs a private test bundle archive corresponding to the target version, if one has not been installed yet.
func (*Client) GetDUTInfo ¶
func (c *Client) GetDUTInfo(ctx context.Context, req *protocol.GetDUTInfoRequest) (res *protocol.GetDUTInfoResponse, retErr error)
GetDUTInfo retrieves various DUT information needed for test execution.
func (*Client) GetSysInfoState ¶
func (c *Client) GetSysInfoState(ctx context.Context, req *protocol.GetSysInfoStateRequest) (res *protocol.GetSysInfoStateResponse, retErr error)
GetSysInfoState collects the sysinfo state of the DUT.
func (*Client) GlobalRuntimeVars ¶
GlobalRuntimeVars client implementation
func (*Client) ListFixtures ¶
func (c *Client) ListFixtures(ctx context.Context) (fixtures []*drivercore.BundleEntity, retErr error)
ListFixtures enumerates all fixtures.
func (*Client) ListTests ¶
func (c *Client) ListTests(ctx context.Context, patterns []string, features *protocol.Features) (tests []*drivercore.BundleEntity, retErr error)
ListTests enumerates tests matching patterns.
func (*Client) RunTests ¶
func (c *Client) RunTests(ctx context.Context, bcfg *protocol.BundleConfig, rcfg *protocol.RunConfig, out RunTestsOutput)
RunTests requests to run tests according to the given RunConfig. Test execution events are streamed back via out. See RunTestsOutput for details.
type RunTestsOutput ¶
type RunTestsOutput interface { // RunStart is called exactly once at the beginning of an overall test // execution. RunStart(ctx context.Context) error EntityStart(ctx context.Context, ev *protocol.EntityStartEvent) error EntityLog(ctx context.Context, ev *protocol.EntityLogEvent) error EntityError(ctx context.Context, ev *protocol.EntityErrorEvent) error EntityEnd(ctx context.Context, ev *protocol.EntityEndEvent) error RunLog(ctx context.Context, ev *protocol.RunLogEvent) error // RunEnd is called exactly once at the end of an overall test execution. // If any other method returns a non-nil error, test execution is aborted // immediately and RunEnd is called with the error. RunEnd(ctx context.Context, err error) }
RunTestsOutput is implemented by callers of RunTests to receive test execution events.
Its methods (except RunStart and RunEnd) are called on receiving a corresponding test execution event. In case of errors, they can be called in an inconsistent way (e.g. EntityEnd is not called after EntityStart due to a test crash). RunTestsOutput implementations must be prepared to handle such error cases correctly.
All methods except RunEnd can return an error, which leads to immediate abort of the test execution and subsequent RunEnd call.