Documentation ¶
Index ¶
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") )
Functions ¶
func InsertMany ¶
func InsertMany(results []TestResult) error
Types ¶
type TestResult ¶
type TestResult struct { ID bson.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"` }
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 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 (*TestResult) Insert ¶
func (t *TestResult) Insert() error
Insert writes a test result to the database.
Click to show internal directories.
Click to hide internal directories.