runner

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithMultiDb

func RunWithMultiDb(t *testing.T, params *RunWithMultiDbParams)

RunWithMultiDb is a helper function the wraps the common Run and provides simple way to configure Gonkey by filling the params structure.

func RunWithTesting

func RunWithTesting(t *testing.T, params *RunWithTestingParams)

RunWithTesting is a helper function the wraps the common Run and provides simple way to configure Gonkey by filling the params structure.

Types

type Aerospike

type Aerospike struct {
	*aerospike.Client
	Namespace string
}

type Config

type Config struct {
	Host                  string
	GrpcHost              string
	FixturesLoader        fixtures.Loader
	FixturesLoaderMultiDb fixtures.LoaderMultiDb
	Mocks                 *mocks.Mocks
	MocksLoader           *mocks.Loader
	GrpcMocks             *grpcmock.GrpcMocks
	GrpcMocksLoader       *grpcmock.GrpcLoader
	Variables             *variables.Variables
	HTTPProxyURL          *url.URL
	RequestTimeout        time.Duration

	// Grpc groups gRPC-transport-specific tuning. Zero value preserves
	// historical behavior, so non-gRPC users can leave it unset.
	Grpc GrpcOptions
}

type ConsoleHandler

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

func NewConsoleHandler

func NewConsoleHandler() *ConsoleHandler

func (*ConsoleHandler) HandleTest

func (h *ConsoleHandler) HandleTest(test models.TestInterface, executeTest testExecutor) error

func (*ConsoleHandler) Summary

func (h *ConsoleHandler) Summary() *models.Summary

type DbMapInstance

type DbMapInstance struct {
	DB     *sql.DB
	DbType fixtures.DbType
}

type GrpcOptions added in v1.4.2

type GrpcOptions struct {
	// EmitDefaultFields, when true, forces proto3 zero-value fields
	// (false bool, 0 numbers, empty string, empty repeated/map) to be
	// rendered in the gRPC response JSON body. The grpcurl default is
	// false, which omits these fields and breaks YAML expectations that
	// assert on them explicitly (e.g. allowed: false, total: 0, roles: []).
	EmitDefaultFields bool

	// IncludeTextSeparator is forwarded to grpcurl.RequestParserAndFormatterFor
	// as the includeTextSeparator argument. Default false.
	IncludeTextSeparator bool
}

GrpcOptions groups gRPC-transport-specific tuning forwarded to grpcurl. Zero value matches the historical grpcurl defaults.

type GrpcTransport

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

GrpcTransport is a transportExecutor implementation for gRPC calls without proto stubs. It uses grpcurl as a library for dynamic invocations via server reflection or protoset files.

func (*GrpcTransport) Close

func (t *GrpcTransport) Close() error

Close closes the persistent gRPC connection.

func (*GrpcTransport) Execute

func (t *GrpcTransport) Execute(ctx context.Context, test models.TestInterface) (*models.Result, error)

Execute performs a single gRPC call and returns the result.

type HttpTransport

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

func (*HttpTransport) Execute

func (t *HttpTransport) Execute(ctx context.Context, test models.TestInterface) (*models.Result, error)

type RunWithMultiDbParams

type RunWithMultiDbParams struct {
	Server        *httptest.Server
	TestsDir      string
	Mocks         *mocks.Mocks
	FixturesDir   string
	DbMap         map[string]*DbMapInstance
	Aerospike     Aerospike
	EnvFilePath   string
	OutputFunc    output.OutputInterface
	Checkers      []checker.CheckerInterface
	FixtureLoader fixtures.LoaderMultiDb
}

type RunWithTestingParams

type RunWithTestingParams struct {
	Server      *httptest.Server
	GrpcHost    string
	TestsDir    string
	Mocks       *mocks.Mocks
	GrpcMocks   *grpcmock.GrpcMocks
	FixturesDir string
	DB          *sql.DB
	Aerospike   Aerospike
	// If DB parameter present, used to recognize type of database, if not set, by default uses Postgres
	DbType        fixtures.DbType
	EnvFilePath   string
	OutputFunc    output.OutputInterface
	Checkers      []checker.CheckerInterface
	FixtureLoader fixtures.Loader
	// TestIT labels: can be overridden by test-level labels
	AllurePackage   string
	AllureTestClass string
	// Grpc forwards gRPC-transport-specific options into Config.Grpc.
	Grpc GrpcOptions
}

type Runner

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

func New

func New(config *Config, loader testloader.LoaderInterface, handler testHandler) *Runner

func (*Runner) AddCheckers

func (r *Runner) AddCheckers(c ...checker.CheckerInterface)

func (*Runner) AddOutput

func (r *Runner) AddOutput(o ...output.OutputInterface)

func (*Runner) Run

func (r *Runner) Run() error

Directories

Path Synopsis
mocks

Jump to

Keyboard shortcuts

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