Documentation
¶
Overview ¶
Package resultdb is a ResultDB client used by the Swarming server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockRecorderClientFactory ¶
func NewMockRecorderClientFactory(expectedRequest proto.Message, inv *rdbpb.Invocation, err error, updateToken string) *mockClientFactory
NewMockRecorderClientFactory returns RecorderClientFactory to create mocked recorder client for tests.
Types ¶
type RecorderClient ¶
type RecorderClient struct {
// contains filtered or unexported fields
}
RecorderClient is a ResultDB Recorder API wrapper for swarming-specific usage.
In prod, a Recorder for interacting with ResultDB's Recorder service will be used. Tests should use a fake implementation.
func (*RecorderClient) CreateInvocation ¶
func (recorder *RecorderClient) CreateInvocation(ctx context.Context, taskID, realm string, deadline time.Time) (invName string, updateToken string, err error)
CreateInvocation creates a ResultDB invocation for the task.
`taskID` should be the task ID as run result (ending with 1).
Returns the created invocation's name and update token. May also return a grpc error if something is wrong.
func (*RecorderClient) FinalizeInvocation ¶
func (recorder *RecorderClient) FinalizeInvocation(ctx context.Context, taskID string, updateToken string) error
FinalizeInvocation finalized the ResultDB invocation for the task.
type RecorderFactory ¶
type RecorderFactory interface { // MakeClient creates a client to interact with ResultDB Recorder. MakeClient(ctx context.Context, host string, project string) (*RecorderClient, error) }
RecorderFactory creates a client to interact with ResultDB Recorder.
func NewRecorderFactory ¶
func NewRecorderFactory(swarmingProject string) RecorderFactory
NewRecorderFactory returns a RecorderFactory to create a Recorder client in production.