testresult

package
v1.10.49 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package testresult is a generated GoMock package.

Index

Constants

View Source
const CollectionName = "testresults"
View Source
const PageDefaultLimit int = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Name() string
	NameDefined() bool
	LastNDays() int
	LastNDaysDefined() bool
	StartDate() time.Time
	StartDateDefined() bool
	EndDate() time.Time
	EndDateDefined() bool
	Statuses() testkube.TestSuiteExecutionStatuses
	StatusesDefined() bool
	Page() int
	PageSize() int
	TextSearchDefined() bool
	TextSearch() string
	Selector() string
}

type FilterImpl added in v1.9.2

type FilterImpl struct {
	FName       string
	FLastNDays  int
	FStartDate  *time.Time
	FEndDate    *time.Time
	FStatuses   testkube.TestSuiteExecutionStatuses
	FPage       int
	FPageSize   int
	FTextSearch string
	FSelector   string
}

func NewExecutionsFilter

func NewExecutionsFilter() *FilterImpl

func (FilterImpl) EndDate added in v1.9.2

func (f FilterImpl) EndDate() time.Time

func (FilterImpl) EndDateDefined added in v1.9.2

func (f FilterImpl) EndDateDefined() bool

func (FilterImpl) LastNDays added in v1.9.2

func (f FilterImpl) LastNDays() int

func (FilterImpl) LastNDaysDefined added in v1.9.2

func (f FilterImpl) LastNDaysDefined() bool

func (FilterImpl) Name added in v1.9.2

func (f FilterImpl) Name() string

func (FilterImpl) NameDefined added in v1.9.2

func (f FilterImpl) NameDefined() bool

func (FilterImpl) Page added in v1.9.2

func (f FilterImpl) Page() int

func (FilterImpl) PageSize added in v1.9.2

func (f FilterImpl) PageSize() int

func (FilterImpl) Selector added in v1.9.2

func (f FilterImpl) Selector() string

func (FilterImpl) StartDate added in v1.9.2

func (f FilterImpl) StartDate() time.Time

func (FilterImpl) StartDateDefined added in v1.9.2

func (f FilterImpl) StartDateDefined() bool

func (FilterImpl) Statuses added in v1.9.2

func (FilterImpl) StatusesDefined added in v1.9.2

func (f FilterImpl) StatusesDefined() bool

func (FilterImpl) TextSearch added in v1.9.2

func (f FilterImpl) TextSearch() string

func (FilterImpl) TextSearchDefined added in v1.9.2

func (f FilterImpl) TextSearchDefined() bool

func (*FilterImpl) WithEndDate added in v1.9.2

func (f *FilterImpl) WithEndDate(date time.Time) *FilterImpl

func (*FilterImpl) WithLastNDays added in v1.9.2

func (f *FilterImpl) WithLastNDays(days int) *FilterImpl

func (*FilterImpl) WithName added in v1.9.2

func (f *FilterImpl) WithName(name string) *FilterImpl

func (*FilterImpl) WithPage added in v1.9.2

func (f *FilterImpl) WithPage(page int) *FilterImpl

func (*FilterImpl) WithPageSize added in v1.9.2

func (f *FilterImpl) WithPageSize(pageSize int) *FilterImpl

func (*FilterImpl) WithSelector added in v1.9.2

func (f *FilterImpl) WithSelector(selector string) *FilterImpl

func (*FilterImpl) WithStartDate added in v1.9.2

func (f *FilterImpl) WithStartDate(date time.Time) *FilterImpl

func (*FilterImpl) WithStatus added in v1.9.2

func (f *FilterImpl) WithStatus(status string) *FilterImpl

func (*FilterImpl) WithTextSearch added in v1.9.2

func (f *FilterImpl) WithTextSearch(textSearch string) *FilterImpl

type MockRepository

type MockRepository struct {
	// contains filtered or unexported fields
}

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) DeleteAll

func (m *MockRepository) DeleteAll(arg0 context.Context) error

DeleteAll mocks base method.

func (*MockRepository) DeleteByTestSuite

func (m *MockRepository) DeleteByTestSuite(arg0 context.Context, arg1 string) error

DeleteByTestSuite mocks base method.

func (*MockRepository) DeleteByTestSuites

func (m *MockRepository) DeleteByTestSuites(arg0 context.Context, arg1 []string) error

DeleteByTestSuites mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) EndExecution

func (m *MockRepository) EndExecution(arg0 context.Context, arg1 testkube.TestSuiteExecution) error

EndExecution mocks base method.

func (*MockRepository) Get

Get mocks base method.

func (*MockRepository) GetByNameAndTestSuite

func (m *MockRepository) GetByNameAndTestSuite(arg0 context.Context, arg1, arg2 string) (testkube.TestSuiteExecution, error)

GetByNameAndTestSuite mocks base method.

func (*MockRepository) GetExecutions

func (m *MockRepository) GetExecutions(arg0 context.Context, arg1 Filter) ([]testkube.TestSuiteExecution, error)

GetExecutions mocks base method.

func (*MockRepository) GetExecutionsTotals

func (m *MockRepository) GetExecutionsTotals(arg0 context.Context, arg1 ...Filter) (testkube.ExecutionsTotals, error)

GetExecutionsTotals mocks base method.

func (*MockRepository) GetLatestByTestSuite

func (m *MockRepository) GetLatestByTestSuite(arg0 context.Context, arg1, arg2 string) (testkube.TestSuiteExecution, error)

GetLatestByTestSuite mocks base method.

func (*MockRepository) GetLatestByTestSuites

func (m *MockRepository) GetLatestByTestSuites(arg0 context.Context, arg1 []string, arg2 string) ([]testkube.TestSuiteExecution, error)

GetLatestByTestSuites mocks base method.

func (*MockRepository) GetTestSuiteMetrics

func (m *MockRepository) GetTestSuiteMetrics(arg0 context.Context, arg1 string, arg2, arg3 int) (testkube.ExecutionsMetrics, error)

GetTestSuiteMetrics mocks base method.

func (*MockRepository) Insert

Insert mocks base method.

func (*MockRepository) StartExecution

func (m *MockRepository) StartExecution(arg0 context.Context, arg1 string, arg2 time.Time) error

StartExecution mocks base method.

func (*MockRepository) Update

Update mocks base method.

type MockRepositoryMockRecorder

type MockRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) DeleteAll

func (mr *MockRepositoryMockRecorder) DeleteAll(arg0 interface{}) *gomock.Call

DeleteAll indicates an expected call of DeleteAll.

func (*MockRepositoryMockRecorder) DeleteByTestSuite

func (mr *MockRepositoryMockRecorder) DeleteByTestSuite(arg0, arg1 interface{}) *gomock.Call

DeleteByTestSuite indicates an expected call of DeleteByTestSuite.

func (*MockRepositoryMockRecorder) DeleteByTestSuites

func (mr *MockRepositoryMockRecorder) DeleteByTestSuites(arg0, arg1 interface{}) *gomock.Call

DeleteByTestSuites indicates an expected call of DeleteByTestSuites.

func (*MockRepositoryMockRecorder) EndExecution

func (mr *MockRepositoryMockRecorder) EndExecution(arg0, arg1 interface{}) *gomock.Call

EndExecution indicates an expected call of EndExecution.

func (*MockRepositoryMockRecorder) Get

func (mr *MockRepositoryMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockRepositoryMockRecorder) GetByNameAndTestSuite

func (mr *MockRepositoryMockRecorder) GetByNameAndTestSuite(arg0, arg1, arg2 interface{}) *gomock.Call

GetByNameAndTestSuite indicates an expected call of GetByNameAndTestSuite.

func (*MockRepositoryMockRecorder) GetExecutions

func (mr *MockRepositoryMockRecorder) GetExecutions(arg0, arg1 interface{}) *gomock.Call

GetExecutions indicates an expected call of GetExecutions.

func (*MockRepositoryMockRecorder) GetExecutionsTotals

func (mr *MockRepositoryMockRecorder) GetExecutionsTotals(arg0 interface{}, arg1 ...interface{}) *gomock.Call

GetExecutionsTotals indicates an expected call of GetExecutionsTotals.

func (*MockRepositoryMockRecorder) GetLatestByTestSuite

func (mr *MockRepositoryMockRecorder) GetLatestByTestSuite(arg0, arg1, arg2 interface{}) *gomock.Call

GetLatestByTestSuite indicates an expected call of GetLatestByTestSuite.

func (*MockRepositoryMockRecorder) GetLatestByTestSuites

func (mr *MockRepositoryMockRecorder) GetLatestByTestSuites(arg0, arg1, arg2 interface{}) *gomock.Call

GetLatestByTestSuites indicates an expected call of GetLatestByTestSuites.

func (*MockRepositoryMockRecorder) GetTestSuiteMetrics

func (mr *MockRepositoryMockRecorder) GetTestSuiteMetrics(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

GetTestSuiteMetrics indicates an expected call of GetTestSuiteMetrics.

func (*MockRepositoryMockRecorder) Insert

func (mr *MockRepositoryMockRecorder) Insert(arg0, arg1 interface{}) *gomock.Call

Insert indicates an expected call of Insert.

func (*MockRepositoryMockRecorder) StartExecution

func (mr *MockRepositoryMockRecorder) StartExecution(arg0, arg1, arg2 interface{}) *gomock.Call

StartExecution indicates an expected call of StartExecution.

func (*MockRepositoryMockRecorder) Update

func (mr *MockRepositoryMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update.

type MongoRepository

type MongoRepository struct {
	Coll *mongo.Collection
	// contains filtered or unexported fields
}

func NewMongoRepository added in v1.9.2

func NewMongoRepository(db *mongo.Database, allowDiskUse bool, opts ...MongoRepositoryOpt) *MongoRepository

func (*MongoRepository) DeleteAll

func (r *MongoRepository) DeleteAll(ctx context.Context) (err error)

DeleteAll deletes all execution results

func (*MongoRepository) DeleteByTestSuite

func (r *MongoRepository) DeleteByTestSuite(ctx context.Context, testSuiteName string) (err error)

DeleteByTestSuite deletes execution results by test suite

func (*MongoRepository) DeleteByTestSuites

func (r *MongoRepository) DeleteByTestSuites(ctx context.Context, testSuiteNames []string) (err error)

DeleteByTestSuites deletes execution results by test suites

func (*MongoRepository) EndExecution

func (r *MongoRepository) EndExecution(ctx context.Context, e testkube.TestSuiteExecution) (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) GetByNameAndTestSuite

func (r *MongoRepository) GetByNameAndTestSuite(ctx context.Context, name, testSuiteName 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) GetLatestByTestSuite

func (r *MongoRepository) GetLatestByTestSuite(ctx context.Context, testSuiteName, sortField string) (result testkube.TestSuiteExecution, err error)

func (*MongoRepository) GetLatestByTestSuites

func (r *MongoRepository) GetLatestByTestSuites(ctx context.Context, testSuiteNames []string, sortField string) (executions []testkube.TestSuiteExecution, err error)

func (*MongoRepository) GetNewestExecutions

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

func (*MongoRepository) GetTestSuiteMetrics

func (r *MongoRepository) GetTestSuiteMetrics(ctx context.Context, name string, limit, last int) (metrics testkube.ExecutionsMetrics, err error)

GetTestSuiteMetrics returns test executions metrics

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 MongoRepositoryOpt added in v1.9.2

type MongoRepositoryOpt func(*MongoRepository)

func WithMongoRepositoryCollection added in v1.9.2

func WithMongoRepositoryCollection(collection *mongo.Collection) MongoRepositoryOpt

type Repository

type Repository interface {
	// Get gets execution result by id or name
	Get(ctx context.Context, id string) (testkube.TestSuiteExecution, error)
	// GetByNameAndTestSuite gets execution result by name
	GetByNameAndTestSuite(ctx context.Context, name, testSuiteName string) (testkube.TestSuiteExecution, error)
	// GetLatestByTestSuite gets latest execution result by test suite
	GetLatestByTestSuite(ctx context.Context, testSuiteName, sortField string) (testkube.TestSuiteExecution, error)
	// GetLatestByTestSuites gets latest execution results by test suite names
	GetLatestByTestSuites(ctx context.Context, testSuiteNames []string, sortField string) (executions []testkube.TestSuiteExecution, err 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, execution testkube.TestSuiteExecution) error
	// DeleteByTestSuite deletes execution results by test suite
	DeleteByTestSuite(ctx context.Context, testSuiteName string) error
	// DeleteAll deletes all execution results
	DeleteAll(ctx context.Context) error
	// DeleteByTestSuites deletes execution results by test suites
	DeleteByTestSuites(ctx context.Context, testSuiteNames []string) (err error)

	GetTestSuiteMetrics(ctx context.Context, name string, limit, last int) (metrics testkube.ExecutionsMetrics, err error)
}

Jump to

Keyboard shortcuts

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