result

package
v1.16.17 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package result is a generated GoMock package.

Package result is a generated GoMock package.

Index

Constants

View Source
const (
	CollectionResults   = "results"
	CollectionSequences = "sequences"
	// OutputPrefixSize is the size of the beginning of execution output in case this doesn't fit into Mongo
	OutputPrefixSize = 1 * 1024 * 1024
	// OutputMaxSize is the size of the execution output in case this doesn't fit into the 16 MB limited by Mongo
	OutputMaxSize = 14 * 1024 * 1024
	// OverflownOutputWarn is the message that lets the user know the output had to be trimmed
	OverflownOutputWarn = "WARNING: Output was shortened in order to fit into MongoDB."
	// StepMaxCount is the maximum number of steps saved into Mongo - due to the 16 MB document size limitation
	StepMaxCount = 100
)
View Source
const CollectionOutput = "output"
View Source
const PageDefaultLimit int = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionOutput

type ExecutionOutput struct {
	Id            string `json:"id"`
	Name          string `json:"name"`
	TestName      string `json:"testname,omitempty"`
	TestSuiteName string `json:"testsuitename,omitempty"`
	Output        string `json:"output"`
}

type Filter

type Filter interface {
	TestName() string
	TestNameDefined() bool
	LastNDays() int
	LastNDaysDefined() bool
	StartDate() time.Time
	StartDateDefined() bool
	EndDate() time.Time
	EndDateDefined() bool
	Statuses() testkube.ExecutionStatuses
	StatusesDefined() bool
	Page() int
	PageSize() int
	TextSearchDefined() bool
	TextSearch() string
	Selector() string
	TypeDefined() bool
	Type() string
}

type FilterImpl

type FilterImpl struct {
	FTestName   string                     `json:"testName"`
	FStartDate  *time.Time                 `json:"startDate"`
	FEndDate    *time.Time                 `json:"endDate"`
	FLastNDays  int                        `json:"lastNDays"`
	FStatuses   testkube.ExecutionStatuses `json:"statuses"`
	FPage       int                        `json:"page"`
	FPageSize   int                        `json:"pageSize"`
	FTextSearch string                     `json:"textSearch"`
	FSelector   string                     `json:"selector"`
	FObjectType string                     `json:"objectType"`
}

func NewExecutionsFilter

func NewExecutionsFilter() *FilterImpl

func (*FilterImpl) EndDate

func (f *FilterImpl) EndDate() time.Time

func (*FilterImpl) EndDateDefined

func (f *FilterImpl) EndDateDefined() bool

func (*FilterImpl) LastNDays

func (f *FilterImpl) LastNDays() int

func (*FilterImpl) LastNDaysDefined

func (f *FilterImpl) LastNDaysDefined() bool

func (*FilterImpl) Page

func (f *FilterImpl) Page() int

func (*FilterImpl) PageSize

func (f *FilterImpl) PageSize() int

func (*FilterImpl) Selector

func (f *FilterImpl) Selector() string

func (*FilterImpl) StartDate

func (f *FilterImpl) StartDate() time.Time

func (*FilterImpl) StartDateDefined

func (f *FilterImpl) StartDateDefined() bool

func (*FilterImpl) Statuses

func (f *FilterImpl) Statuses() testkube.ExecutionStatuses

func (*FilterImpl) StatusesDefined

func (f *FilterImpl) StatusesDefined() bool

func (*FilterImpl) TestName

func (f *FilterImpl) TestName() string

func (*FilterImpl) TestNameDefined

func (f *FilterImpl) TestNameDefined() bool

func (*FilterImpl) TextSearch

func (f *FilterImpl) TextSearch() string

func (*FilterImpl) TextSearchDefined

func (f *FilterImpl) TextSearchDefined() bool

func (*FilterImpl) Type

func (f *FilterImpl) Type() string

func (*FilterImpl) TypeDefined

func (f *FilterImpl) TypeDefined() bool

func (*FilterImpl) WithEndDate

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

func (*FilterImpl) WithLastNDays

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

func (*FilterImpl) WithPage

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

func (*FilterImpl) WithPageSize

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

func (*FilterImpl) WithSelector

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

func (*FilterImpl) WithStartDate

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

func (*FilterImpl) WithStatus

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

func (*FilterImpl) WithTestName

func (f *FilterImpl) WithTestName(testName string) *FilterImpl

func (*FilterImpl) WithTextSearch

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

func (*FilterImpl) WithType

func (f *FilterImpl) WithType(objectType string) *FilterImpl

type MinioRepository

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

func NewMinioOutputRepository

func NewMinioOutputRepository(storageClient storage.Client, executionCollection *mongo.Collection, bucket string) *MinioRepository

func (*MinioRepository) DeleteAllOutput

func (m *MinioRepository) DeleteAllOutput(ctx context.Context) error

func (*MinioRepository) DeleteOutput

func (m *MinioRepository) DeleteOutput(ctx context.Context, id, testName, testSuiteName string) error

func (*MinioRepository) DeleteOutputByTest

func (m *MinioRepository) DeleteOutputByTest(ctx context.Context, testName string) error

func (*MinioRepository) DeleteOutputByTestSuite

func (m *MinioRepository) DeleteOutputByTestSuite(ctx context.Context, testSuiteName string) error

func (*MinioRepository) DeleteOutputForAllTestSuite

func (m *MinioRepository) DeleteOutputForAllTestSuite(ctx context.Context) error

func (*MinioRepository) DeleteOutputForTestSuites

func (m *MinioRepository) DeleteOutputForTestSuites(ctx context.Context, testSuiteNames []string) error

func (*MinioRepository) DeleteOutputForTests

func (m *MinioRepository) DeleteOutputForTests(ctx context.Context, testNames []string) error

func (*MinioRepository) GetOutput

func (m *MinioRepository) GetOutput(ctx context.Context, id, testName, testSuiteName string) (output string, err error)

func (*MinioRepository) GetOutputSize added in v1.15.1

func (m *MinioRepository) GetOutputSize(ctx context.Context, executionID, testName, testSuiteName string) (size int, err error)

func (*MinioRepository) InsertOutput

func (m *MinioRepository) InsertOutput(ctx context.Context, id, testName, testSuiteName, output string) error

func (*MinioRepository) StreamOutput added in v1.15.1

func (m *MinioRepository) StreamOutput(ctx context.Context, executionID, testName, testSuiteName string) (reader io.Reader, err error)

func (*MinioRepository) UpdateOutput

func (m *MinioRepository) UpdateOutput(ctx context.Context, id, testName, testSuiteName, output string) error

type MockOutputRepository added in v1.15.1

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

MockOutputRepository is a mock of OutputRepository interface.

func NewMockOutputRepository added in v1.15.1

func NewMockOutputRepository(ctrl *gomock.Controller) *MockOutputRepository

NewMockOutputRepository creates a new mock instance.

func (*MockOutputRepository) DeleteAllOutput added in v1.15.1

func (m *MockOutputRepository) DeleteAllOutput(arg0 context.Context) error

DeleteAllOutput mocks base method.

func (*MockOutputRepository) DeleteOutput added in v1.15.1

func (m *MockOutputRepository) DeleteOutput(arg0 context.Context, arg1, arg2, arg3 string) error

DeleteOutput mocks base method.

func (*MockOutputRepository) DeleteOutputByTest added in v1.15.1

func (m *MockOutputRepository) DeleteOutputByTest(arg0 context.Context, arg1 string) error

DeleteOutputByTest mocks base method.

func (*MockOutputRepository) DeleteOutputByTestSuite added in v1.15.1

func (m *MockOutputRepository) DeleteOutputByTestSuite(arg0 context.Context, arg1 string) error

DeleteOutputByTestSuite mocks base method.

func (*MockOutputRepository) DeleteOutputForAllTestSuite added in v1.15.1

func (m *MockOutputRepository) DeleteOutputForAllTestSuite(arg0 context.Context) error

DeleteOutputForAllTestSuite mocks base method.

func (*MockOutputRepository) DeleteOutputForTestSuites added in v1.15.1

func (m *MockOutputRepository) DeleteOutputForTestSuites(arg0 context.Context, arg1 []string) error

DeleteOutputForTestSuites mocks base method.

func (*MockOutputRepository) DeleteOutputForTests added in v1.15.1

func (m *MockOutputRepository) DeleteOutputForTests(arg0 context.Context, arg1 []string) error

DeleteOutputForTests mocks base method.

func (*MockOutputRepository) EXPECT added in v1.15.1

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

func (*MockOutputRepository) GetOutput added in v1.15.1

func (m *MockOutputRepository) GetOutput(arg0 context.Context, arg1, arg2, arg3 string) (string, error)

GetOutput mocks base method.

func (*MockOutputRepository) GetOutputSize added in v1.15.1

func (m *MockOutputRepository) GetOutputSize(arg0 context.Context, arg1, arg2, arg3 string) (int, error)

GetOutputSize mocks base method.

func (*MockOutputRepository) InsertOutput added in v1.15.1

func (m *MockOutputRepository) InsertOutput(arg0 context.Context, arg1, arg2, arg3, arg4 string) error

InsertOutput mocks base method.

func (*MockOutputRepository) StreamOutput added in v1.15.1

func (m *MockOutputRepository) StreamOutput(arg0 context.Context, arg1, arg2, arg3 string) (io.Reader, error)

StreamOutput mocks base method.

func (*MockOutputRepository) UpdateOutput added in v1.15.1

func (m *MockOutputRepository) UpdateOutput(arg0 context.Context, arg1, arg2, arg3, arg4 string) error

UpdateOutput mocks base method.

type MockOutputRepositoryMockRecorder added in v1.15.1

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

MockOutputRepositoryMockRecorder is the mock recorder for MockOutputRepository.

func (*MockOutputRepositoryMockRecorder) DeleteAllOutput added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteAllOutput(arg0 interface{}) *gomock.Call

DeleteAllOutput indicates an expected call of DeleteAllOutput.

func (*MockOutputRepositoryMockRecorder) DeleteOutput added in v1.15.1

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

DeleteOutput indicates an expected call of DeleteOutput.

func (*MockOutputRepositoryMockRecorder) DeleteOutputByTest added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteOutputByTest(arg0, arg1 interface{}) *gomock.Call

DeleteOutputByTest indicates an expected call of DeleteOutputByTest.

func (*MockOutputRepositoryMockRecorder) DeleteOutputByTestSuite added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteOutputByTestSuite(arg0, arg1 interface{}) *gomock.Call

DeleteOutputByTestSuite indicates an expected call of DeleteOutputByTestSuite.

func (*MockOutputRepositoryMockRecorder) DeleteOutputForAllTestSuite added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteOutputForAllTestSuite(arg0 interface{}) *gomock.Call

DeleteOutputForAllTestSuite indicates an expected call of DeleteOutputForAllTestSuite.

func (*MockOutputRepositoryMockRecorder) DeleteOutputForTestSuites added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteOutputForTestSuites(arg0, arg1 interface{}) *gomock.Call

DeleteOutputForTestSuites indicates an expected call of DeleteOutputForTestSuites.

func (*MockOutputRepositoryMockRecorder) DeleteOutputForTests added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) DeleteOutputForTests(arg0, arg1 interface{}) *gomock.Call

DeleteOutputForTests indicates an expected call of DeleteOutputForTests.

func (*MockOutputRepositoryMockRecorder) GetOutput added in v1.15.1

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

GetOutput indicates an expected call of GetOutput.

func (*MockOutputRepositoryMockRecorder) GetOutputSize added in v1.15.1

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

GetOutputSize indicates an expected call of GetOutputSize.

func (*MockOutputRepositoryMockRecorder) InsertOutput added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) InsertOutput(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

InsertOutput indicates an expected call of InsertOutput.

func (*MockOutputRepositoryMockRecorder) StreamOutput added in v1.15.1

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

StreamOutput indicates an expected call of StreamOutput.

func (*MockOutputRepositoryMockRecorder) UpdateOutput added in v1.15.1

func (mr *MockOutputRepositoryMockRecorder) UpdateOutput(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

UpdateOutput indicates an expected call of UpdateOutput.

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) DeleteByTest

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

DeleteByTest 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) DeleteByTests

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

DeleteByTests mocks base method.

func (*MockRepository) DeleteForAllTestSuites

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

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

EndExecution mocks base method.

func (*MockRepository) Get

Get mocks base method.

func (*MockRepository) GetByNameAndTest

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

GetByNameAndTest mocks base method.

func (*MockRepository) GetExecutionTotals

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

GetExecutionTotals mocks base method.

func (*MockRepository) GetExecutions

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

GetExecutions mocks base method.

func (*MockRepository) GetLabels

func (m *MockRepository) GetLabels(arg0 context.Context) (map[string][]string, error)

GetLabels mocks base method.

func (*MockRepository) GetLatestByTest

func (m *MockRepository) GetLatestByTest(arg0 context.Context, arg1 string) (*testkube.Execution, error)

GetLatestByTest mocks base method.

func (*MockRepository) GetLatestByTests

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

GetLatestByTests mocks base method.

func (*MockRepository) GetNextExecutionNumber

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

GetNextExecutionNumber mocks base method.

func (*MockRepository) GetTestMetrics

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

GetTestMetrics mocks base method.

func (*MockRepository) Insert

func (m *MockRepository) Insert(arg0 context.Context, arg1 testkube.Execution) error

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

func (m *MockRepository) Update(arg0 context.Context, arg1 testkube.Execution) error

Update mocks base method.

func (*MockRepository) UpdateResult

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

UpdateResult 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) DeleteByTest

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

DeleteByTest indicates an expected call of DeleteByTest.

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) DeleteByTests

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

DeleteByTests indicates an expected call of DeleteByTests.

func (*MockRepositoryMockRecorder) DeleteForAllTestSuites

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

DeleteForAllTestSuites indicates an expected call of DeleteForAllTestSuites.

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) GetByNameAndTest

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

GetByNameAndTest indicates an expected call of GetByNameAndTest.

func (*MockRepositoryMockRecorder) GetExecutionTotals

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

GetExecutionTotals indicates an expected call of GetExecutionTotals.

func (*MockRepositoryMockRecorder) GetExecutions

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

GetExecutions indicates an expected call of GetExecutions.

func (*MockRepositoryMockRecorder) GetLabels

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

GetLabels indicates an expected call of GetLabels.

func (*MockRepositoryMockRecorder) GetLatestByTest

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

GetLatestByTest indicates an expected call of GetLatestByTest.

func (*MockRepositoryMockRecorder) GetLatestByTests

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

GetLatestByTests indicates an expected call of GetLatestByTests.

func (*MockRepositoryMockRecorder) GetNextExecutionNumber

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

GetNextExecutionNumber indicates an expected call of GetNextExecutionNumber.

func (*MockRepositoryMockRecorder) GetTestMetrics

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

GetTestMetrics indicates an expected call of GetTestMetrics.

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.

func (*MockRepositoryMockRecorder) UpdateResult

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

UpdateResult indicates an expected call of UpdateResult.

type MongoOutputRepository

type MongoOutputRepository struct {
	Coll *mongo.Collection
}

func NewMongoOutputRepository

func NewMongoOutputRepository(db *mongo.Database, opts ...MongoOutputRepositoryOpt) *MongoOutputRepository

func (*MongoOutputRepository) DeleteAllOutput

func (r *MongoOutputRepository) DeleteAllOutput(ctx context.Context) error

func (*MongoOutputRepository) DeleteOutput

func (r *MongoOutputRepository) DeleteOutput(ctx context.Context, id, testName, testSuiteName string) error

func (*MongoOutputRepository) DeleteOutputByTest

func (r *MongoOutputRepository) DeleteOutputByTest(ctx context.Context, testName string) error

func (*MongoOutputRepository) DeleteOutputByTestSuite

func (r *MongoOutputRepository) DeleteOutputByTestSuite(ctx context.Context, testSuiteName string) error

func (*MongoOutputRepository) DeleteOutputForAllTestSuite

func (r *MongoOutputRepository) DeleteOutputForAllTestSuite(ctx context.Context) error

func (*MongoOutputRepository) DeleteOutputForTestSuites

func (r *MongoOutputRepository) DeleteOutputForTestSuites(ctx context.Context, testSuiteNames []string) error

func (*MongoOutputRepository) DeleteOutputForTests

func (r *MongoOutputRepository) DeleteOutputForTests(ctx context.Context, testNames []string) error

func (*MongoOutputRepository) GetOutput

func (r *MongoOutputRepository) GetOutput(ctx context.Context, id, testName, testSuiteName string) (output string, err error)

func (*MongoOutputRepository) GetOutputSize added in v1.15.1

func (r *MongoOutputRepository) GetOutputSize(ctx context.Context, executionID, testName, testSuiteName string) (size int, err error)

func (*MongoOutputRepository) InsertOutput

func (r *MongoOutputRepository) InsertOutput(ctx context.Context, id, testName, testSuiteName, output string) error

func (*MongoOutputRepository) StreamOutput added in v1.15.1

func (r *MongoOutputRepository) StreamOutput(ctx context.Context, executionID, testName, testSuiteName string) (reader io.Reader, err error)

func (*MongoOutputRepository) UpdateOutput

func (r *MongoOutputRepository) UpdateOutput(ctx context.Context, id, testName, testSuiteName, output string) error

type MongoOutputRepositoryOpt

type MongoOutputRepositoryOpt func(*MongoOutputRepository)

func WithMongoOutputRepositoryCollection

func WithMongoOutputRepositoryCollection(collection *mongo.Collection) MongoOutputRepositoryOpt

type MongoRepository

type MongoRepository struct {
	ResultsColl      *mongo.Collection
	SequencesColl    *mongo.Collection
	OutputRepository OutputRepository
	// contains filtered or unexported fields
}

func NewMongoRepository

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

func NewMongoRepositoryWithMinioOutputStorage

func NewMongoRepositoryWithMinioOutputStorage(db *mongo.Database, allowDiskUse bool, storageClient storage.Client, bucket string) *MongoRepository

func NewMongoRepositoryWithOutputRepository

func NewMongoRepositoryWithOutputRepository(
	db *mongo.Database,
	allowDiskUse bool,
	outputRepository OutputRepository,
	opts ...MongoRepositoryOpt,
) *MongoRepository

func (*MongoRepository) DeleteAll

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

DeleteAll deletes all execution results

func (*MongoRepository) DeleteAllExecutionNumbers added in v1.11.7

func (r *MongoRepository) DeleteAllExecutionNumbers(ctx context.Context, isTestSuite bool) (err error)

func (*MongoRepository) DeleteByTest

func (r *MongoRepository) DeleteByTest(ctx context.Context, testName string) (err error)

DeleteByTest deletes execution results by test

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) DeleteByTests

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

DeleteByTests deletes execution results by tests

func (*MongoRepository) DeleteExecutionNumber added in v1.11.7

func (r *MongoRepository) DeleteExecutionNumber(ctx context.Context, name string) (err error)

func (*MongoRepository) DeleteExecutionNumbers added in v1.11.7

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

func (*MongoRepository) DeleteForAllTestSuites

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

DeleteForAllTestSuites deletes execution results for all test suites

func (*MongoRepository) EndExecution

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

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

func (*MongoRepository) GetExecutionTotals

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

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

func (*MongoRepository) GetLatestByTest

func (r *MongoRepository) GetLatestByTest(ctx context.Context, testName string) (*testkube.Execution, error)

func (*MongoRepository) GetLatestByTests

func (r *MongoRepository) GetLatestByTests(ctx context.Context, testNames []string) (executions []testkube.Execution, err error)

func (*MongoRepository) GetLatestTestNumber added in v1.16.0

func (r *MongoRepository) GetLatestTestNumber(ctx context.Context, testName string) (num int32, err error)

func (*MongoRepository) GetNewestExecutions

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

func (*MongoRepository) GetNextExecutionNumber

func (r *MongoRepository) GetNextExecutionNumber(ctx context.Context, name string) (number int32, err error)

func (*MongoRepository) GetTestMetrics

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

GetTestMetrics returns test executions metrics limited to number of executions or last N days

func (*MongoRepository) Insert

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

func (*MongoRepository) UpdateResult

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

type MongoRepositoryOpt

type MongoRepositoryOpt func(*MongoRepository)

func WithMongoRepositoryResultCollection

func WithMongoRepositoryResultCollection(collection *mongo.Collection) MongoRepositoryOpt

func WithMongoRepositorySequenceCollection

func WithMongoRepositorySequenceCollection(collection *mongo.Collection) MongoRepositoryOpt

type OutputRepository

type OutputRepository interface {
	// GetOutput gets execution output by id or name
	GetOutput(ctx context.Context, id, testName, testSuiteName string) (output string, err error)
	// InsertOutput inserts new execution output
	InsertOutput(ctx context.Context, id, testName, testSuiteName, output string) error
	// UpdateOutput updates execution output
	UpdateOutput(ctx context.Context, id, testName, testSuiteName, output string) error
	// DeleteOutput deletes execution output
	DeleteOutput(ctx context.Context, id, testName, testSuiteName string) error
	// DeleteOutputByTest deletes execution output by test
	DeleteOutputByTest(ctx context.Context, testName string) error
	// DeleteOutputForTests deletes execution output for tests
	DeleteOutputForTests(ctx context.Context, testNames []string) error
	// DeleteOutputByTestSuite deletes execution output by test suite
	DeleteOutputByTestSuite(ctx context.Context, testSuiteName string) error
	// DeleteOutputForTestSuites deletes execution output for test suites
	DeleteOutputForTestSuites(ctx context.Context, testSuiteNames []string) error
	// DeleteAllOutput deletes all execution output
	DeleteAllOutput(ctx context.Context) error
	// DeleteOutputForAllTestSuite deletes all execution output for test suite
	DeleteOutputForAllTestSuite(ctx context.Context) error
	// StreamOutput streams execution output by id or name
	StreamOutput(ctx context.Context, executionID, testName, testSuiteName string) (reader io.Reader, err error)
	// GetOutputSize gets execution output metadata by id or name
	GetOutputSize(ctx context.Context, executionID, testName, testSuiteName string) (size int, err error)
}

type Repository

type Repository interface {
	Sequences
	// Get gets execution result by id or name
	Get(ctx context.Context, id string) (testkube.Execution, error)
	// GetByNameAndTest gets execution result by name and test name
	GetByNameAndTest(ctx context.Context, name, testName string) (testkube.Execution, error)
	// GetLatestByTest gets latest execution result by test
	GetLatestByTest(ctx context.Context, testName string) (*testkube.Execution, error)
	// GetLatestByTests gets latest execution results by test names
	GetLatestByTests(ctx context.Context, testNames []string) (executions []testkube.Execution, err 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
	// UpdateResult updates result in execution
	UpdateResult(ctx context.Context, id string, execution testkube.Execution) 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.Execution) error
	// GetLabels get all available labels
	GetLabels(ctx context.Context) (labels map[string][]string, err error)
	// DeleteByTest deletes execution results by test
	DeleteByTest(ctx context.Context, testName string) 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
	// DeleteByTests deletes execution results by tests
	DeleteByTests(ctx context.Context, testNames []string) (err error)
	// DeleteByTestSuites deletes execution results by test suites
	DeleteByTestSuites(ctx context.Context, testSuiteNames []string) (err error)
	// DeleteForAllTestSuites deletes execution results for all test suites
	DeleteForAllTestSuites(ctx context.Context) (err error)

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

type Sequences

type Sequences interface {
	// GetNextExecutionNumber gets next execution number by test name
	GetNextExecutionNumber(ctx context.Context, testName string) (number int32, err error)
}

Jump to

Keyboard shortcuts

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