Documentation
¶
Index ¶
- Constants
- Variables
- func Aggregate(pipeline []bson.M, results interface{}) error
- func ByTaskIDs(ids []string) db.Q
- func Count(query db.Q) (int, error)
- func DeleteWithLimit(ctx context.Context, env evergreen.Environment, ts time.Time, limit int) (int, error)
- func InsertMany(results []TestResult) error
- func TestResultCount(taskIds []string, testName string, statuses []string, execution int) (int, error)
- func TestResultsQuery(taskIds []string, testId, testName, status string, limit, execution int) db.Q
- type TestResult
Constants ¶
View Source
const (
// Collection is the name of the test results collection in the database.
Collection = "testresults"
)
Variables ¶
View Source
var ( // BSON fields for the task struct IDKey = bsonutil.MustHaveTag(TestResult{}, "ID") StatusKey = bsonutil.MustHaveTag(TestResult{}, "Status") LineNumKey = bsonutil.MustHaveTag(TestResult{}, "LineNum") TestFileKey = bsonutil.MustHaveTag(TestResult{}, "TestFile") URLKey = bsonutil.MustHaveTag(TestResult{}, "URL") LogIDKey = bsonutil.MustHaveTag(TestResult{}, "LogID") URLRawKey = bsonutil.MustHaveTag(TestResult{}, "URLRaw") ExitCodeKey = bsonutil.MustHaveTag(TestResult{}, "ExitCode") StartTimeKey = bsonutil.MustHaveTag(TestResult{}, "StartTime") EndTimeKey = bsonutil.MustHaveTag(TestResult{}, "EndTime") TaskIDKey = bsonutil.MustHaveTag(TestResult{}, "TaskID") ExecutionKey = bsonutil.MustHaveTag(TestResult{}, "Execution") ProjectKey = bsonutil.MustHaveTag(TestResult{}, "Project") BuildVariantKey = bsonutil.MustHaveTag(TestResult{}, "BuildVariant") DistroIdKey = bsonutil.MustHaveTag(TestResult{}, "DistroId") RequesterKey = bsonutil.MustHaveTag(TestResult{}, "Requester") DisplayNameKey = bsonutil.MustHaveTag(TestResult{}, "DisplayName") ExecutionDisplayNameKey = bsonutil.MustHaveTag(TestResult{}, "ExecutionDisplayName") TaskCreateTimeKey = bsonutil.MustHaveTag(TestResult{}, "TaskCreateTime") )
Functions ¶
func DeleteWithLimit ¶
func InsertMany ¶
func InsertMany(results []TestResult) error
func TestResultCount ¶
Types ¶
type TestResult ¶
type TestResult struct {
ID mgobson.ObjectId `bson:"_id,omitempty" json:"id"`
Status string `json:"status" bson:"status"`
TestFile string `json:"test_file" bson:"test_file"`
URL string `json:"url" bson:"url,omitempty"`
URLRaw string `json:"url_raw" bson:"url_raw,omitempty"`
LogID string `json:"log_id,omitempty" bson:"log_id,omitempty"`
LineNum int `json:"line_num,omitempty" bson:"line_num,omitempty"`
ExitCode int `json:"exit_code" bson:"exit_code"`
StartTime float64 `json:"start" bson:"start"`
EndTime float64 `json:"end" bson:"end"`
// Together, TaskID and Execution identify the task which created this TestResult
TaskID string `bson:"task_id" json:"task_id"`
Execution int `bson:"task_execution" json:"task_execution"`
// LogRaw is not persisted to the database
LogRaw string `json:"log_raw" bson:"log_raw,omitempty"`
// Denormalize TestResults to add fields from enclosing tasks. This
// facilitates faster historical test stats aggregations.
Project string `bson:"branch" json:"branch"`
BuildVariant string `bson:"build_variant" json:"build_variant"`
DistroId string `bson:"distro" json:"distro"`
Requester string `bson:"r" json:"r"`
DisplayName string `bson:"display_name" json:"display_name"`
ExecutionDisplayName string `bson:"execution_display_name,omitempty" json:"execution_display_name,omitempty"`
TaskCreateTime time.Time `bson:"task_create_time" json:"task_create_time"`
TestStartTime time.Time `json:"test_start_time" bson:"test_start_time"`
TestEndTime time.Time `json:"test_end_time" bson:"test_end_time"`
}
TestResult contains test data for a task.
func Find ¶
func Find(query db.Q) ([]TestResult, error)
find returns all test results that satisfy the query. Returns an empty slice if no tasks match.
func FindByTaskIDAndExecution ¶
func FindByTaskIDAndExecution(taskID string, execution int) ([]TestResult, error)
FindByTaskIDAndExecution returns test results from the testresults collection for a given task.
func TestResultsFilterSortPaginate ¶
func TestResultsFilterSortPaginate(taskIds []string, testName string, statuses []string, sortBy string, sortDir, page, limit, execution int) ([]TestResult, error)
TestResultsFilterSortPaginate is a query for returning test results to the taskTests GQL Query.
func (*TestResult) Insert ¶
func (t *TestResult) Insert() error
Insert writes a test result to the database.
func (*TestResult) MarshalBSON ¶
func (t *TestResult) MarshalBSON() ([]byte, error)
func (*TestResult) UnmarshalBSON ¶
func (t *TestResult) UnmarshalBSON(in []byte) error
Click to show internal directories.
Click to hide internal directories.