Documentation ¶
Index ¶
- Constants
- func NewExecutionsFilter() *filter
- type Filter
- type MongoRepository
- func (r *MongoRepository) EndExecution(ctx context.Context, id string, endTime time.Time, duration time.Duration) (err error)
- func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.TestSuiteExecution, err error)
- func (r *MongoRepository) GetByNameAndTest(ctx context.Context, name, testName string) (result testkube.TestSuiteExecution, err error)
- func (r *MongoRepository) GetExecutions(ctx context.Context, filter Filter) (result []testkube.TestSuiteExecution, err error)
- func (r *MongoRepository) GetExecutionsTotals(ctx context.Context, filter ...Filter) (totals testkube.ExecutionsTotals, err error)
- func (r *MongoRepository) GetLatestByTest(ctx context.Context, testName string) (result testkube.TestSuiteExecution, err error)
- func (r *MongoRepository) GetNewestExecutions(ctx context.Context, limit int) (result []testkube.TestSuiteExecution, err error)
- func (r *MongoRepository) Insert(ctx context.Context, result testkube.TestSuiteExecution) (err error)
- func (r *MongoRepository) StartExecution(ctx context.Context, id string, startTime time.Time) (err error)
- func (r *MongoRepository) Update(ctx context.Context, result testkube.TestSuiteExecution) (err error)
- type Repository
Constants ¶
View Source
const CollectionName = "testresults"
View Source
const PageDefaultLimit int = 1000
TODO: Adjust when it gets too small.
Variables ¶
This section is empty.
Functions ¶
func NewExecutionsFilter ¶
func NewExecutionsFilter() *filter
Types ¶
type MongoRepository ¶
type MongoRepository struct {
Coll *mongo.Collection
}
func NewMongoRespository ¶
func NewMongoRespository(db *mongo.Database) *MongoRepository
func (*MongoRepository) EndExecution ¶
func (r *MongoRepository) EndExecution(ctx context.Context, id string, endTime time.Time, duration time.Duration) (err error)
EndExecution updates execution end time
func (*MongoRepository) Get ¶
func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.TestSuiteExecution, err error)
func (*MongoRepository) GetByNameAndTest ¶ added in v0.9.5
func (r *MongoRepository) GetByNameAndTest(ctx context.Context, name, testName string) (result testkube.TestSuiteExecution, err error)
func (*MongoRepository) GetExecutions ¶
func (r *MongoRepository) GetExecutions(ctx context.Context, filter Filter) (result []testkube.TestSuiteExecution, err error)
func (*MongoRepository) GetExecutionsTotals ¶
func (r *MongoRepository) GetExecutionsTotals(ctx context.Context, filter ...Filter) (totals testkube.ExecutionsTotals, err error)
func (*MongoRepository) GetLatestByTest ¶ added in v0.11.6
func (r *MongoRepository) GetLatestByTest(ctx context.Context, testName string) (result testkube.TestSuiteExecution, err error)
func (*MongoRepository) GetNewestExecutions ¶
func (r *MongoRepository) GetNewestExecutions(ctx context.Context, limit int) (result []testkube.TestSuiteExecution, err error)
func (*MongoRepository) Insert ¶
func (r *MongoRepository) Insert(ctx context.Context, result testkube.TestSuiteExecution) (err error)
func (*MongoRepository) StartExecution ¶
func (r *MongoRepository) StartExecution(ctx context.Context, id string, startTime time.Time) (err error)
StartExecution updates execution start time
func (*MongoRepository) Update ¶
func (r *MongoRepository) Update(ctx context.Context, result testkube.TestSuiteExecution) (err error)
type Repository ¶
type Repository interface { // Get gets execution result by id Get(ctx context.Context, id string) (testkube.TestSuiteExecution, error) // GetByNameAndTest gets execution result by name GetByNameAndTest(ctx context.Context, name, testName string) (testkube.TestSuiteExecution, error) // GetLatestByTest gets latest execution result by test GetLatestByTest(ctx context.Context, testName string) (testkube.TestSuiteExecution, error) // GetExecutionsTotals gets executions total stats using a filter, use filter with no data for all GetExecutionsTotals(ctx context.Context, filter ...Filter) (totals testkube.ExecutionsTotals, err error) // GetExecutions gets executions using a filter, use filter with no data for all GetExecutions(ctx context.Context, filter Filter) ([]testkube.TestSuiteExecution, error) // Insert inserts new execution result Insert(ctx context.Context, result testkube.TestSuiteExecution) error // Update updates execution result Update(ctx context.Context, result testkube.TestSuiteExecution) error // StartExecution updates execution start time StartExecution(ctx context.Context, id string, startTime time.Time) error // EndExecution updates execution end time EndExecution(ctx context.Context, id string, endTime time.Time, duration time.Duration) error }
Click to show internal directories.
Click to hide internal directories.