Back to godoc.org

Package deriver

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package deriver implements a binary that hosts luci.resultdb.v1.Deriver service.

Index

func DeriveChromiumInvocation

func DeriveChromiumInvocation(task *swarmingAPI.SwarmingRpcsTaskResult, req *pb.DeriveChromiumInvocationRequest) (*pb.Invocation, error)

DeriveChromiumInvocation derives the Invocation proto from the given task and request.

The derived Invocation will be written by the caller.

func FetchOutputJSON

func FetchOutputJSON(ctx context.Context, isoClient *isolatedclient.Client, outputs map[string]isolated.File) ([]byte, error)

FetchOutputJSON fetches the output.json given the outputs map, updating it in-place to mark the file as processed.

func GetInvocationID

func GetInvocationID(task *swarmingAPI.SwarmingRpcsTaskResult, req *pb.DeriveChromiumInvocationRequest) invocations.ID

GetInvocationID gets the ID of the invocation associated with a task and swarming service.

func GetOriginTask

func GetOriginTask(ctx context.Context, task *swarmingAPI.SwarmingRpcsTaskResult, swarmSvc *swarmingAPI.Service) (*swarmingAPI.SwarmingRpcsTaskResult, error)

GetOriginTask gets the swarming task of which the given task is a dupe, or itself if it isn't.

func GetOutputs

func GetOutputs(ctx context.Context, isoClient *isolatedclient.Client, ref *swarmingAPI.SwarmingRpcsFilesRef) (map[string]isolated.File, error)

GetOutputs gets the map of isolated.Files associated with the given task.

func GetSwarmSvc

func GetSwarmSvc(cl *http.Client, swarmingURL string) (*swarmingAPI.Service, error)

GetSwarmSvc gets a swarming service for the given URL.

func GetSwarmingTask

func GetSwarmingTask(ctx context.Context, taskID string, swarmSvc *swarmingAPI.Service) (*swarmingAPI.SwarmingRpcsTaskResult, error)

GetSwarmingTask fetches the task from swarming, annotating errors with gRPC codes as needed.

func InitServer

func InitServer(srv *server.Server, opt Options)

InitServer initializes a deriver server.

type Options

type Options struct {
	// BigQuery table that the derived invocations should be exported to.
	InvBQTable *pb.BigQueryExport

	// Duration since invocation creation after which to delete expected test
	// results.
	ExpectedResultsExpiration time.Duration
}

Options is deriver server configuration.

type TestResult

type TestResult struct {
	*pb.TestResult
	Artifacts []*pb.Artifact
}

TestResult combines test result with the associated artifacts.

func DeriveTestResults

func DeriveTestResults(ctx context.Context, task *swarmingAPI.SwarmingRpcsTaskResult, req *pb.DeriveChromiumInvocationRequest, inv *pb.Invocation) ([]*TestResult, error)

DeriveTestResults derives the protos with the data from the given task and request.

The derived Invocation and TestResult protos will be written by the caller.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier