resultdb

package
v0.0.0-...-c76aa60 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

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 InvocationID

func InvocationID(swarmingProject, taskID string) string

InvocationID returns the task's ResultDB invocation ID.

func InvocationName

func InvocationName(swarmingProject, taskID string) string

InvocationName returns the task's ResultDB invocation name.

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.

Jump to

Keyboard shortcuts

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