Documentation ¶
Overview ¶
Package exporter contains methods to export test results to BigQuery.
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 provides methods to export test results to BigQuery via the BigQuery Write API.
func NewClient ¶
NewClient creates a new client for exporting test results via the BigQuery Write API.
func (*Client) Insert ¶
func (c *Client) Insert(ctx context.Context, rows []*bqpb.TestResultRow, dest ExportDestination) error
Insert inserts the given rows in BigQuery.
type ExportDestination ¶
type ExportDestination struct { // A unique key for the export destination, using only characters [a-z\-]. Key string // contains filtered or unexported fields }
var ByDayTable ExportDestination
ByDayTable is a BigQuery table optimised for access by single partition day(s) at a time.
var ByMonthTable ExportDestination
ByMonthTable is a BigQuery table optimised for accessing many months of data for each test_id.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter provides methods to stream test results to BigQuery.
func NewExporter ¶
func NewExporter(client InsertClient) *Exporter
NewExporter instantiates a new Exporter. The given client is used to insert rows into BigQuery.
func (*Exporter) Export ¶
func (e *Exporter) Export(ctx context.Context, verdicts []*rdbpb.RunTestVerdict, dest ExportDestination, opts Options) error
Export exports the test results in the given run verdicts to BigQuery.
type FakeClient ¶
type FakeClient struct { // Insertions is the set of test results which were attempted // to be exported using the client. InsertionsByDestinationKey map[string][]*bqpb.TestResultRow }
FakeClient represents a fake implementation of the test results exporter, for testing.
func NewFakeClient ¶
func NewFakeClient() *FakeClient
NewFakeClient initialises a new client for exporting test results.
func (*FakeClient) Insert ¶
func (fc *FakeClient) Insert(ctx context.Context, rows []*bqpb.TestResultRow, dest ExportDestination) error
Insert inserts the given rows.
type InsertClient ¶
type InsertClient interface { // Insert inserts the given rows into BigQuery. Insert(ctx context.Context, rows []*bqpb.TestResultRow, dest ExportDestination) error }
InsertClient defines an interface for inserting rows into BigQuery.