testresult

package
v0.7.6-beta003 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 Filter

type Filter interface {
	Name() string
	NameDefined() bool
	StartDate() time.Time
	StartDateDefined() bool
	EndDate() time.Time
	EndDateDefined() bool
	Page() int
	PageSize() int
	TextSearchDefined() bool
	TextSearch() string
}

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) (err error)

EndExecution updates execution end time

func (*MongoRepository) Get

func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.TestExecution, err error)

func (*MongoRepository) GetByNameAndScript

func (r *MongoRepository) GetByNameAndScript(ctx context.Context, name, script string) (result testkube.TestExecution, err error)

func (*MongoRepository) GetExecutions

func (r *MongoRepository) GetExecutions(ctx context.Context, filter Filter) (result []testkube.TestExecution, err error)

func (*MongoRepository) GetNewestExecutions

func (r *MongoRepository) GetNewestExecutions(ctx context.Context, limit int) (result []testkube.TestExecution, err error)

func (*MongoRepository) Insert

func (r *MongoRepository) Insert(ctx context.Context, result testkube.TestExecution) (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.TestExecution) (err error)

type Repository

type Repository interface {
	// Get gets execution result by id
	Get(ctx context.Context, id string) (testkube.TestExecution, error)
	// GetByNameAndScript gets execution result by name
	GetByNameAndScript(ctx context.Context, name, script string) (testkube.TestExecution, error)
	// GetExecutions gets executions using a filter, use filter with no data for all
	GetExecutions(ctx context.Context, filter Filter) ([]testkube.TestExecution, error)
	// Insert inserts new execution result
	Insert(ctx context.Context, result testkube.TestExecution) error
	// Update updates execution result
	Update(ctx context.Context, result testkube.TestExecution) 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) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL