resultdb

package
v0.0.0-...-ca1514f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package resultdb contains logic of interacting with resultdb.

Index

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 the client to communicate with ResultDB. It wraps a rdbpb.ResultDBClient.

func NewClient

func NewClient(ctx context.Context, host, project string) (*Client, error)

NewClient creates a client to communicate with ResultDB, acting as the given project. Recommended way to construct a ResultDB client.

func NewPrivilegedClient

func NewPrivilegedClient(ctx context.Context, host string) (*Client, error)

NewPrivilegedClient creates a client to communicate with ResultDB, acting as LUCI Analysis to access data from any project.

Caution: Callers must take special care to avoid "confused deputy" issues when using this client, e.g. being tricked by one project to access the resources of another. ResultDB will not check the accessed resource is in the project that was intended.

func (*Client) GetInvocation

func (c *Client) GetInvocation(ctx context.Context, invName string) (*rdbpb.Invocation, error)

GetInvocation retrieves the invocation.

func (*Client) QueryRunTestVerdicts

QueryRunTestVerdicts queries a single page of test variants from a test run.

func (*Client) QueryTestVariants

QueryTestVariants queries a single page of test variants.

type MockedClient

type MockedClient struct {
	Client *rdbpb.MockResultDBClient
	Ctx    context.Context
}

MockedClient is a mocked ResultDB client for testing. It wraps a rdbpb.MockResultDBClient and a context with the mocked client.

func NewMockedClient

func NewMockedClient(ctx context.Context, ctl *gomock.Controller) *MockedClient

NewMockedClient creates a MockedClient for testing.

func (*MockedClient) BatchGetTestVariants

BatchGetTestVariants mocks the BatchGetTestVariants RPC.

func (*MockedClient) GetInvocation

func (mc *MockedClient) GetInvocation(req *rdbpb.GetInvocationRequest, res *rdbpb.Invocation)

GetInvocation mocks the GetInvocation RPC.

func (*MockedClient) GetRealm

func (mc *MockedClient) GetRealm(inv, realm string)

GetRealm is a shortcut of GetInvocation to get realm of the invocation.

func (*MockedClient) QueryRunTestVerdicts

QueryRunTestVerdicts mocks the QueryRunTestVerdicts RPC.

func (*MockedClient) QueryTestVariants

QueryTestVariants mocks the QueryTestVariants RPC.

Jump to

Keyboard shortcuts

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