Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestResultFile_Format_name = map[int32]string{
		0: "LUCI",
		1: "CHROMIUM_JSON_TEST_RESULTS",
		2: "GOOGLE_TEST",
	}
	TestResultFile_Format_value = map[string]int32{
		"LUCI":                       0,
		"CHROMIUM_JSON_TEST_RESULTS": 1,
		"GOOGLE_TEST":                2,
	}
)

Enum value maps for TestResultFile_Format.

View Source
var File_go_chromium_org_luci_resultdb_sink_proto_v1_location_tag_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_resultdb_sink_proto_v1_sink_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_resultdb_sink_proto_v1_test_result_proto protoreflect.FileDescriptor

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterSinkServer

func RegisterSinkServer(s prpc.Registrar, srv SinkServer)

Types

type Artifact

type Artifact struct {

	// Types that are assignable to Body:
	//	*Artifact_FilePath
	//	*Artifact_Contents
	Body isArtifact_Body `protobuf_oneof:"body"`
	// Equivalent of luci.resultdb.v1.Artifact.content_type.
	ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

A local equivalent of luci.resultdb.Artifact message in ../../rpc/v1/artifact.proto. See its comments for details. Does not have a name or artifact_id because they are represented by the TestResult.artifacts map key.

func (*Artifact) Descriptor

func (*Artifact) Descriptor() ([]byte, []int)

Deprecated: Use Artifact.ProtoReflect.Descriptor instead.

func (*Artifact) GetBody

func (m *Artifact) GetBody() isArtifact_Body

func (*Artifact) GetContentType

func (x *Artifact) GetContentType() string

func (*Artifact) GetContents

func (x *Artifact) GetContents() []byte

func (*Artifact) GetFilePath

func (x *Artifact) GetFilePath() string

func (*Artifact) ProtoMessage

func (*Artifact) ProtoMessage()

func (*Artifact) ProtoReflect

func (x *Artifact) ProtoReflect() protoreflect.Message

func (*Artifact) Reset

func (x *Artifact) Reset()

func (*Artifact) String

func (x *Artifact) String() string

type Artifact_Contents

type Artifact_Contents struct {
	// Contents of the artifact. Useful when sending a file from a different
	// machine.
	// TODO(nodir, sajjadm): allow sending contents in chunks.
	Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3,oneof"`
}

type Artifact_FilePath

type Artifact_FilePath struct {
	// Absolute path to the artifact file on the same machine as the
	// ResultSink server.
	FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3,oneof"`
}

type DecoratedSink

type DecoratedSink struct {
	// Service is the service to decorate.
	Service SinkServer
	// Prelude is called for each method before forwarding the call to Service.
	// If Prelude returns an error, then the call is skipped and the error is
	// processed via the Postlude (if one is defined), or it is returned directly.
	Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error)
	// Postlude is called for each method after Service has processed the call, or
	// after the Prelude has returned an error. This takes the the Service's
	// response proto (which may be nil) and/or any error. The decorated
	// service will return the response (possibly mutated) and error that Postlude
	// returns.
	Postlude func(ctx context.Context, methodName string, rsp proto.Message, err error) error
}

func (*DecoratedSink) ReportInvocationLevelArtifacts

func (s *DecoratedSink) ReportInvocationLevelArtifacts(ctx context.Context, req *ReportInvocationLevelArtifactsRequest) (rsp *emptypb.Empty, err error)

func (*DecoratedSink) ReportTestResults

func (s *DecoratedSink) ReportTestResults(ctx context.Context, req *ReportTestResultsRequest) (rsp *ReportTestResultsResponse, err error)

type LocationTags

type LocationTags struct {

	// The key is a Gitiles URL as the identifier for a repo.
	// Format for Gitiles URL: https://<host>/<project>
	// For example "https://chromium.googlesource.com/chromium/src"
	// Must not end with ".git".
	Repos map[string]*LocationTags_Repo `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

Maps from directory paths to extra tags to attach to TestResults. When converted to JSON format, it will look like below: {

"repos": {
  "https://chromium.googlesource.com/chromium/src" : {
    "dirs": {
      ".": {
        "tags": {
          "monorail_project": "chromium"
        }
      },
      "foo": {
        "tags": {
          "monorail_project": "chromium",
          "monorail_component": "Monorail>Component",
          "teamEmail": "team_email@chromium.org",
          "os": "WINDOWS"
        }
      }
    }
  }
}

}

func (*LocationTags) Descriptor

func (*LocationTags) Descriptor() ([]byte, []int)

Deprecated: Use LocationTags.ProtoReflect.Descriptor instead.

func (*LocationTags) GetRepos

func (x *LocationTags) GetRepos() map[string]*LocationTags_Repo

func (*LocationTags) ProtoMessage

func (*LocationTags) ProtoMessage()

func (*LocationTags) ProtoReflect

func (x *LocationTags) ProtoReflect() protoreflect.Message

func (*LocationTags) Reset

func (x *LocationTags) Reset()

func (*LocationTags) String

func (x *LocationTags) String() string

type LocationTags_Dir

type LocationTags_Dir struct {

	// If a key is not defined for subdir, but defined for an ancestor dir, then
	// the value(s) in the ancestor is implied.
	//
	// A key can be repeated.
	Tags []*v1.StringPair `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

Extra tags to attach to TestResults for a directory.

func (*LocationTags_Dir) Descriptor

func (*LocationTags_Dir) Descriptor() ([]byte, []int)

Deprecated: Use LocationTags_Dir.ProtoReflect.Descriptor instead.

func (*LocationTags_Dir) GetTags

func (x *LocationTags_Dir) GetTags() []*v1.StringPair

func (*LocationTags_Dir) ProtoMessage

func (*LocationTags_Dir) ProtoMessage()

func (*LocationTags_Dir) ProtoReflect

func (x *LocationTags_Dir) ProtoReflect() protoreflect.Message

func (*LocationTags_Dir) Reset

func (x *LocationTags_Dir) Reset()

func (*LocationTags_Dir) String

func (x *LocationTags_Dir) String() string

type LocationTags_Repo

type LocationTags_Repo struct {

	// The key is a relative dir path.
	// "" means repo root and represents default for all subdirs.
	// Must use forward slash as a dir separator.
	Dirs map[string]*LocationTags_Dir `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

Map from directory paths in a repo to extra tags to attach to TestResults.

func (*LocationTags_Repo) Descriptor

func (*LocationTags_Repo) Descriptor() ([]byte, []int)

Deprecated: Use LocationTags_Repo.ProtoReflect.Descriptor instead.

func (*LocationTags_Repo) GetDirs

func (x *LocationTags_Repo) GetDirs() map[string]*LocationTags_Dir

func (*LocationTags_Repo) ProtoMessage

func (*LocationTags_Repo) ProtoMessage()

func (*LocationTags_Repo) ProtoReflect

func (x *LocationTags_Repo) ProtoReflect() protoreflect.Message

func (*LocationTags_Repo) Reset

func (x *LocationTags_Repo) Reset()

func (*LocationTags_Repo) String

func (x *LocationTags_Repo) String() string

type ReportInvocationLevelArtifactsRequest

type ReportInvocationLevelArtifactsRequest struct {

	// Invocation-level artifacts to report.
	// The map key is an artifact id.
	Artifacts map[string]*Artifact `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ReportInvocationLevelArtifactsRequest) Descriptor

func (*ReportInvocationLevelArtifactsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReportInvocationLevelArtifactsRequest.ProtoReflect.Descriptor instead.

func (*ReportInvocationLevelArtifactsRequest) GetArtifacts

func (x *ReportInvocationLevelArtifactsRequest) GetArtifacts() map[string]*Artifact

func (*ReportInvocationLevelArtifactsRequest) ProtoMessage

func (*ReportInvocationLevelArtifactsRequest) ProtoMessage()

func (*ReportInvocationLevelArtifactsRequest) ProtoReflect

func (*ReportInvocationLevelArtifactsRequest) Reset

func (*ReportInvocationLevelArtifactsRequest) String

type ReportTestResultsRequest

type ReportTestResultsRequest struct {

	// Test results to report.
	TestResults []*TestResult `protobuf:"bytes,1,rep,name=test_results,json=testResults,proto3" json:"test_results,omitempty"`
	// contains filtered or unexported fields
}

func (*ReportTestResultsRequest) Descriptor

func (*ReportTestResultsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReportTestResultsRequest.ProtoReflect.Descriptor instead.

func (*ReportTestResultsRequest) GetTestResults

func (x *ReportTestResultsRequest) GetTestResults() []*TestResult

func (*ReportTestResultsRequest) ProtoMessage

func (*ReportTestResultsRequest) ProtoMessage()

func (*ReportTestResultsRequest) ProtoReflect

func (x *ReportTestResultsRequest) ProtoReflect() protoreflect.Message

func (*ReportTestResultsRequest) Reset

func (x *ReportTestResultsRequest) Reset()

func (*ReportTestResultsRequest) String

func (x *ReportTestResultsRequest) String() string

type ReportTestResultsResponse

type ReportTestResultsResponse struct {

	// List of unique identifiers that can be used to link to these results
	// or requested via luci.resultdb.v1.ResultDB service.
	TestResultNames []string `protobuf:"bytes,1,rep,name=test_result_names,json=testResultNames,proto3" json:"test_result_names,omitempty"`
	// contains filtered or unexported fields
}

func (*ReportTestResultsResponse) Descriptor

func (*ReportTestResultsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReportTestResultsResponse.ProtoReflect.Descriptor instead.

func (*ReportTestResultsResponse) GetTestResultNames

func (x *ReportTestResultsResponse) GetTestResultNames() []string

func (*ReportTestResultsResponse) ProtoMessage

func (*ReportTestResultsResponse) ProtoMessage()

func (*ReportTestResultsResponse) ProtoReflect

func (*ReportTestResultsResponse) Reset

func (x *ReportTestResultsResponse) Reset()

func (*ReportTestResultsResponse) String

func (x *ReportTestResultsResponse) String() string

type SinkClient

type SinkClient interface {
	// Reports test results.
	ReportTestResults(ctx context.Context, in *ReportTestResultsRequest, opts ...grpc.CallOption) (*ReportTestResultsResponse, error)
	// Reports invocation-level artifacts.
	// To upload result-level artifact, use ReportTestResults instead.
	ReportInvocationLevelArtifacts(ctx context.Context, in *ReportInvocationLevelArtifactsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

SinkClient is the client API for Sink service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSinkClient

func NewSinkClient(cc grpc.ClientConnInterface) SinkClient

func NewSinkPRPCClient

func NewSinkPRPCClient(client *prpc.Client) SinkClient

type SinkServer

type SinkServer interface {
	// Reports test results.
	ReportTestResults(context.Context, *ReportTestResultsRequest) (*ReportTestResultsResponse, error)
	// Reports invocation-level artifacts.
	// To upload result-level artifact, use ReportTestResults instead.
	ReportInvocationLevelArtifacts(context.Context, *ReportInvocationLevelArtifactsRequest) (*emptypb.Empty, error)
}

SinkServer is the server API for Sink service.

type TestResult

type TestResult struct {

	// Equivalent of luci.resultdb.v1.TestResult.TestId.
	TestId string `protobuf:"bytes,1,opt,name=test_id,json=testId,proto3" json:"test_id,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.result_id.
	//
	// If omitted, a random, unique ID is generated..
	ResultId string `protobuf:"bytes,2,opt,name=result_id,json=resultId,proto3" json:"result_id,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.expected.
	Expected bool `protobuf:"varint,3,opt,name=expected,proto3" json:"expected,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.status.
	Status v1.TestStatus `protobuf:"varint,4,opt,name=status,proto3,enum=luci.resultdb.v1.TestStatus" json:"status,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.summary_html.
	SummaryHtml string `protobuf:"bytes,5,opt,name=summary_html,json=summaryHtml,proto3" json:"summary_html,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.start_time.
	StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.duration.
	Duration *durationpb.Duration `protobuf:"bytes,7,opt,name=duration,proto3" json:"duration,omitempty"`
	// Equivalent of luci.resultdb.v1.TestResult.tags.
	Tags []*v1.StringPair `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"`
	// Artifacts to upload and associate with this test result.
	// The map key is an artifact id.
	Artifacts map[string]*Artifact `` /* 159-byte string literal not displayed */
	// Equivalent of luci.resultdb.v1.TestResult.test_metadata.
	TestMetadata *v1.TestMetadata `protobuf:"bytes,11,opt,name=test_metadata,json=testMetadata,proto3" json:"test_metadata,omitempty"`
	// contains filtered or unexported fields
}

A local equivalent of luci.resultdb.TestResult message in ../../v1/test_result.proto. See its comments for details.

func (*TestResult) Descriptor

func (*TestResult) Descriptor() ([]byte, []int)

Deprecated: Use TestResult.ProtoReflect.Descriptor instead.

func (*TestResult) GetArtifacts

func (x *TestResult) GetArtifacts() map[string]*Artifact

func (*TestResult) GetDuration

func (x *TestResult) GetDuration() *durationpb.Duration

func (*TestResult) GetExpected

func (x *TestResult) GetExpected() bool

func (*TestResult) GetResultId

func (x *TestResult) GetResultId() string

func (*TestResult) GetStartTime

func (x *TestResult) GetStartTime() *timestamppb.Timestamp

func (*TestResult) GetStatus

func (x *TestResult) GetStatus() v1.TestStatus

func (*TestResult) GetSummaryHtml

func (x *TestResult) GetSummaryHtml() string

func (*TestResult) GetTags

func (x *TestResult) GetTags() []*v1.StringPair

func (*TestResult) GetTestId

func (x *TestResult) GetTestId() string

func (*TestResult) GetTestMetadata

func (x *TestResult) GetTestMetadata() *v1.TestMetadata

func (*TestResult) ProtoMessage

func (*TestResult) ProtoMessage()

func (*TestResult) ProtoReflect

func (x *TestResult) ProtoReflect() protoreflect.Message

func (*TestResult) Reset

func (x *TestResult) Reset()

func (*TestResult) String

func (x *TestResult) String() string

type TestResultFile

type TestResultFile struct {

	// Absolute OS-native path to the results file on the same machine as the
	// ResultSink server.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// Format of the file.
	Format TestResultFile_Format `protobuf:"varint,2,opt,name=format,proto3,enum=luci.resultsink.v1.TestResultFile_Format" json:"format,omitempty"`
	// contains filtered or unexported fields
}

A file with test results.

func (*TestResultFile) Descriptor

func (*TestResultFile) Descriptor() ([]byte, []int)

Deprecated: Use TestResultFile.ProtoReflect.Descriptor instead.

func (*TestResultFile) GetFormat

func (x *TestResultFile) GetFormat() TestResultFile_Format

func (*TestResultFile) GetPath

func (x *TestResultFile) GetPath() string

func (*TestResultFile) ProtoMessage

func (*TestResultFile) ProtoMessage()

func (*TestResultFile) ProtoReflect

func (x *TestResultFile) ProtoReflect() protoreflect.Message

func (*TestResultFile) Reset

func (x *TestResultFile) Reset()

func (*TestResultFile) String

func (x *TestResultFile) String() string

type TestResultFile_Format

type TestResultFile_Format int32

A result file format.

const (
	// The file is a sequence of TestResult JSON objects (not a JSON Array).
	// The default format.
	TestResultFile_LUCI TestResultFile_Format = 0
	// Chromium's JSON Test Results format
	// https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md
	TestResultFile_CHROMIUM_JSON_TEST_RESULTS TestResultFile_Format = 1
	// GTest format.
	// Not well documented.
	// Implementation:
	// https://cs.chromium.org/chromium/src/base/test/launcher/test_results_tracker.cc
	TestResultFile_GOOGLE_TEST TestResultFile_Format = 2
)

func (TestResultFile_Format) Descriptor

func (TestResultFile_Format) Enum

func (TestResultFile_Format) EnumDescriptor

func (TestResultFile_Format) EnumDescriptor() ([]byte, []int)

Deprecated: Use TestResultFile_Format.Descriptor instead.

func (TestResultFile_Format) Number

func (TestResultFile_Format) String

func (x TestResultFile_Format) String() string

func (TestResultFile_Format) Type

type UnimplementedSinkServer

type UnimplementedSinkServer struct {
}

UnimplementedSinkServer can be embedded to have forward compatible implementations.

func (*UnimplementedSinkServer) ReportInvocationLevelArtifacts

func (*UnimplementedSinkServer) ReportTestResults