result

package
v0.11.11-beta2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "results"
View Source
const PageDefaultLimit int = 1000

TODO: Adjust when it gets too small.

Variables

This section is empty.

Functions

func NewExecutionsFilter added in v0.6.9

func NewExecutionsFilter() *filter

Types

type Filter added in v0.6.9

type Filter interface {
	TestName() string
	TestNameDefined() bool
	StartDate() time.Time
	StartDateDefined() bool
	EndDate() time.Time
	EndDateDefined() bool
	Status() testkube.ExecutionStatus
	StatusDefined() bool
	Page() int
	PageSize() int
	TextSearchDefined() bool
	TextSearch() string
	Selector() string
	TypeDefined() bool
	Type() string
}

type MongoRepository

type MongoRepository struct {
	Coll *mongo.Collection
}

func NewMongoRespository

func NewMongoRespository(db *mongo.Database) *MongoRepository

func (*MongoRepository) EndExecution added in v0.6.4

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.Execution, err error)

func (*MongoRepository) GetByNameAndTest added in v0.9.5

func (r *MongoRepository) GetByNameAndTest(ctx context.Context, name, testName string) (result testkube.Execution, err error)

func (*MongoRepository) GetExecutionTotals added in v0.6.9

func (r *MongoRepository) GetExecutionTotals(ctx context.Context, paging bool, filter ...Filter) (totals testkube.ExecutionsTotals, err error)

func (*MongoRepository) GetExecutions

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

func (*MongoRepository) GetLabels added in v0.10.0

func (r *MongoRepository) GetLabels(ctx context.Context) (labels map[string][]string, err error)

func (*MongoRepository) GetNewestExecutions

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

func (*MongoRepository) Insert

func (r *MongoRepository) Insert(ctx context.Context, result testkube.Execution) (err error)

func (*MongoRepository) StartExecution added in v0.6.4

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

func (*MongoRepository) UpdateResult

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

type Repository

type Repository interface {
	// Get gets execution result by id
	Get(ctx context.Context, id string) (testkube.Execution, error)
	// GetByNameAndTest gets execution result by name
	GetByNameAndTest(ctx context.Context, name, testName string) (testkube.Execution, error)
	// GetExecutions gets executions using a filter, use filter with no data for all
	GetExecutions(ctx context.Context, filter Filter) ([]testkube.Execution, error)
	// GetExecutionTotals gets the statistics on number of executions using a filter, but without paging
	GetExecutionTotals(ctx context.Context, paging bool, filter ...Filter) (result testkube.ExecutionsTotals, err error)
	// Insert inserts new execution result
	Insert(ctx context.Context, result testkube.Execution) error
	// Update updates execution result
	Update(ctx context.Context, result testkube.Execution) error
	// UpdateExecution updates result in execution
	UpdateResult(ctx context.Context, id string, execution testkube.ExecutionResult) 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
	// GetLabels get all available labels
	GetLabels(ctx context.Context) (labels map[string][]string, err error)
}

Jump to

Keyboard shortcuts

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