regression

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_LINE_LENGTH = 50

Chars PER expected/actual string. Can be changed no problem

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffsPrinter added in v0.9.1

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

func NewDiffsPrinter added in v0.9.1

func NewDiffsPrinter(testCase string) DiffsPrinter

func (*DiffsPrinter) PushBodyDiff added in v0.9.1

func (d *DiffsPrinter) PushBodyDiff(exp, act string, noise []string)

func (*DiffsPrinter) PushHeaderDiff added in v0.9.1

func (d *DiffsPrinter) PushHeaderDiff(exp, act string, noise map[string]string)

func (*DiffsPrinter) PushStatusDiff added in v0.9.1

func (d *DiffsPrinter) PushStatusDiff(exp, act string)

func (*DiffsPrinter) Render added in v0.9.1

func (d *DiffsPrinter) Render()

Will display and colorize diffs side-by-side

type Regression

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

func New

func New(tdb models.TestCaseDB, rdb TestRunDB, testReportFS TestReportFS, adb telemetry.Service, log *zap.Logger, TestExport bool, mFS models.MockFS) *Regression

func (*Regression) DeNoise

func (r *Regression) DeNoise(ctx context.Context, cid, id, app, body string, h http.Header, path, tcsType string) error

func (*Regression) GetTestRun added in v0.7.9

func (r *Regression) GetTestRun(ctx context.Context, summary bool, cid string, user, app, id *string, from, to *time.Time, offset *int, limit *int) ([]*models.TestRun, error)

func (*Regression) Normalize added in v0.7.9

func (r *Regression) Normalize(ctx context.Context, cid, id string) error

func (*Regression) PutTest added in v0.7.9

func (r *Regression) PutTest(ctx context.Context, run models.TestRun, testExport bool, runId, testCasePath, mockPath, testReportPath string, totalTcs int) error

func (*Regression) Test

func (r *Regression) Test(ctx context.Context, cid, app, runID, id, testCasePath, mockPath string, resp models.HttpResp) (bool, error)

func (*Regression) TestGrpc added in v0.7.20

func (r *Regression) TestGrpc(ctx context.Context, resp models.GrpcResp, cid, app, runID, id, testCasePath, mockPath string) (bool, error)

type Service

type Service interface {
	DeNoise(ctx context.Context, cid, id, app, body string, h http.Header, path, tcsType string) error
	Test(ctx context.Context, cid, app, runID, id, testCasePath, mockPath string, resp models.HttpResp) (bool, error)
	// For Grpc
	TestGrpc(ctx context.Context, resp models.GrpcResp, cid, app, runID, id, testCasePath, mockPath string) (bool, error)
	Normalize(ctx context.Context, cid, id string) error
	GetTestRun(ctx context.Context, summary bool, cid string, user, app, id *string, from, to *time.Time, offset *int, limit *int) ([]*models.TestRun, error)
	PutTest(ctx context.Context, run models.TestRun, testExport bool, runId, testCasePath, mockPath, testReportPath string, totalTcs int) error
}

type TestReportFS added in v0.7.9

type TestReportFS interface {
	Write(ctx context.Context, path string, doc models.TestReport) error
	Read(ctx context.Context, path, name string) (models.TestReport, error)
	SetResult(runId string, test models.TestResult)
	GetResults(runId string) ([]models.TestResult, error)
	Lock()
	Unlock()
}

type TestRunDB added in v0.7.9

type TestRunDB interface {
	Read(ctx context.Context, cid string, user, app, id *string, from, to *time.Time, offset int, limit int) ([]*models.TestRun, error)
	Upsert(ctx context.Context, run models.TestRun) error
	ReadOne(ctx context.Context, id string) (*models.TestRun, error)
	ReadTest(ctx context.Context, id string) (models.Test, error)
	ReadTests(ctx context.Context, runID string) ([]models.Test, error)
	PutTest(ctx context.Context, t models.Test) error
	Increment(ctx context.Context, success, failure bool, id string) error
}

Jump to

Keyboard shortcuts

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