Documentation
¶
Index ¶
- Constants
- func Get(ctx context.Context, opts GetOptions) ([]byte, int, error)
- func GetFailedSamples(ctx context.Context, opts GetFailedSampleOptions) ([]byte, error)
- type Client
- type CreateOptions
- type FailedTestSampleOptions
- type FilterOptions
- type GetFailedSampleOptions
- type GetOptions
- type LogInfo
- type Result
- type Results
- type SortBy
- type TaskInfo
- type TaskOptions
Constants ¶
const ( SortByStart = "start" SortByDuration = "duration" SortByTestName = "test_name" SortByStatus = "status" SortByBaseStatus = "base_status" )
Valid sort by keys.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the test results requested via HTTP to a Cedar service along with the status code of the request.
func GetFailedSamples ¶
func GetFailedSamples(ctx context.Context, opts GetFailedSampleOptions) ([]byte, error)
GetFailedSamples returns the failed samples requested via HTTP to a Cedar service.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a wrapper around a gRPC client for sending test results to Cedar.
func NewClient ¶
NewClient returns a Client to send test results to Cedar. If authentication credentials are not specified, then an insecure connection will be established with the specified address and port.
func NewClientWithExistingConnection ¶
NewClientWithExistingConnection returns a Client to send test results to Cedar using the given client connection. The given client connection's lifetime will not be managed by this client.
func (*Client) AddResults ¶
AddResults adds a set of test results to the record.
func (*Client) CloseClient ¶
CloseClient closes the client connection if it was created via NewClient. If an existing connection was used to create the client, it will not be closed.
func (*Client) CloseRecord ¶
CloseRecord marks a record as completed.
func (*Client) CreateRecord ¶
CreateRecord creates a new metadata record in Cedar with the given options.
type CreateOptions ¶
type CreateOptions struct {
Project string `bson:"project" json:"project" yaml:"project"`
Version string `bson:"version" json:"version" yaml:"version"`
Variant string `bson:"variant" json:"variant" yaml:"variant"`
TaskID string `bson:"task_id" json:"task_id" yaml:"task_id"`
TaskName string `bson:"task_name" json:"task_name" yaml:"task_name"`
DisplayTaskName string `bson:"display_task_name" json:"display_task_name" yaml:"display_task_name"`
DisplayTaskID string `bson:"display_task_id" json:"display_task_id" yaml:"display_task_id"`
Execution int32 `bson:"execution" json:"execution" yaml:"execution"`
RequestType string `bson:"request_type" json:"request_type" yaml:"request_type"`
Mainline bool `bson:"mainline" json:"mainline" yaml:"mainline"`
}
CreateOptions represent options to create a new test results record.
type FailedTestSampleOptions ¶
type FailedTestSampleOptions struct {
Tasks []TaskInfo `json:"tasks"`
RegexFilters []string `json:"regex_filters,omitempty"`
}
FailedTestSampleOptions specifies the tasks to get the sample for and regexes to filter the test names by.
type FilterOptions ¶
type FilterOptions struct {
TestName string `json:"test_name,omitempty"`
ExcludeDisplayNames bool `json:"exclude_display_names"`
Statuses []string `json:"statuses,omitempty"`
GroupID string `json:"group_id,omitempty"`
Sort []SortBy `json:"sort"`
Limit int `json:"limit,omitempty"`
Page int `json:"page,omitempty"`
BaseTasks []TaskOptions `json:"base_tasks,omitempty"`
}
FilterOptions represent the parameters for filtering, sorting, and paginating test results. These options are only supported on select routes.
type GetFailedSampleOptions ¶
type GetFailedSampleOptions struct {
Cedar timber.GetOptions
// Request information. See Cedar's REST documentation for more
// information:
// `https://github.com/evergreen-ci/cedar/wiki/Rest-V1-Usage`.
SampleOptions FailedTestSampleOptions
}
GetFailedSampleOptions specify the required and optional information to create the failed test sample HTTP GET request to Cedar.
func (GetFailedSampleOptions) Validate ¶
func (opts GetFailedSampleOptions) Validate() error
Validate ensures GetSampleOptions is configured correctly.
type GetOptions ¶
type GetOptions struct {
Cedar timber.GetOptions
// Request information. See Cedar's REST documentation for more
// information:
// `https://github.com/evergreen-ci/cedar/wiki/Rest-V1-Usage`.
Tasks []TaskOptions
Filter *FilterOptions
FailedSample bool
Stats bool
}
GetOptions specify the required and optional information to create the test results HTTP GET request to Cedar.
func (GetOptions) Validate ¶
func (opts GetOptions) Validate() error
Validate ensures TestResultsGetOptions is configured correctly.
type LogInfo ¶
type LogInfo struct {
LogName string
LogsToMerge []string
LineNum int32
RenderingType *string
Version int32
}
LogInfo describes a metadata for a result's log stored using Evergreen logging.
type Result ¶
type Result struct {
TestName string `bson:"test_name" json:"test_name" yaml:"test_name"`
DisplayTestName string `bson:"display_test_name" json:"display_test_name" yaml:"display_test_name"`
GroupID string `bson:"group_id" json:"group_id" yaml:"group_id"`
Trial int32 `bson:"trial" json:"trial" yaml:"trial"`
Status string `bson:"status" json:"status" yaml:"status"`
LogInfo *LogInfo `bson:"log_info" json:"log_info" yaml:"log_info"`
TaskCreated time.Time `bson:"task_created" json:"task_created" yaml:"task_created"`
TestStarted time.Time `bson:"test_started" json:"test_started" yaml:"test_started"`
TestEnded time.Time `bson:"test_ended" json:"test_ended" yaml:"test_ended"`
// Legacy test log fields.
LogTestName string `bson:"log_test_name" json:"log_test_name" yaml:"log_test_name"`
LogURL string `bson:"log_url" json:"log_url" yaml:"log_url"`
RawLogURL string `bson:"raw_log_url" json:"raw_log_url" yaml:"raw_log_url"`
LineNum int32 `bson:"line_num" json:"line_num" yaml:"line_num"`
}
Result represents a single test result.
type TaskInfo ¶
type TaskInfo struct {
TaskID string `json:"task_id"`
Execution int `json:"execution"`
DisplayTask bool `json:"display_task"`
}
TaskInfo specifies a set of test results to find.
type TaskOptions ¶
TaskOptions specify the information required to fetch test results by task.