test

package
v1.6.20 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group")
)

Functions

func Main

func Main()

Main runs a test

func Register

func Register(name string, suite TestingSuite)

Register registers a test suite Deprecated: Use registry.RegisterTestSuite instead

func RegisterWorkerServiceServer

func RegisterWorkerServiceServer(s *grpc.Server, srv WorkerServiceServer)

func Run

func Run(config *Config) error

Run runs the test

func RunTests

func RunTests(t *testing.T, suite TestingSuite, request *TestRequest)

RunTests runs a test suite

Types

type AfterTest

type AfterTest interface {
	AfterTest(testName string) error
}

AfterTest is an interface for executing code after every test

type BeforeTest

type BeforeTest interface {
	BeforeTest(testName string) error
}

BeforeTest is an interface for executing code before every test

type Config

type Config struct {
	*job.Config `json:",inline"`
	Suites      []string          `json:"suites,omitempty"`
	Tests       []string          `json:"tests,omitempty"`
	Iterations  int               `json:"iterations,omitempty"`
	Verbose     bool              `json:"verbose,omitempty"`
	NoTeardown  bool              `json:"noteardown,omitempty"`
	Args        map[string]string `json:"args,omitempty"`
}

Config is a test configuration

type Coordinator

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

Coordinator coordinates workers for suites of tests

func (*Coordinator) Run

func (c *Coordinator) Run() (int, error)

Run runs the tests

type SetupTest

type SetupTest interface {
	SetupTest() error
}

SetupTest is an interface for setting up individual tests

type SetupTestSuite

type SetupTestSuite interface {
	SetupTestSuite(c *input.Context) error
}

SetupTestSuite is an interface for setting up a suite of tests

type Suite

type Suite struct{}

Suite is an identifier interface for test suites

type TearDownTest

type TearDownTest interface {
	TearDownTest() error
}

TearDownTest is an interface for tearing down individual tests

type TearDownTestSuite

type TearDownTestSuite interface {
	TearDownTestSuite() error
}

TearDownTestSuite is an interface for tearing down a suite of tests

type TestRequest

type TestRequest struct {
	// suite is the test suite to run
	Suite string `protobuf:"bytes,1,opt,name=suite,proto3" json:"suite,omitempty"`
	// tests are the tests to run
	Tests []string `protobuf:"bytes,2,rep,name=tests,proto3" json:"tests,omitempty"`
	// args is the test arguments
	Args map[string]string `` /* 149-byte string literal not displayed */
}

TestRequest is a test request

func (*TestRequest) Descriptor

func (*TestRequest) Descriptor() ([]byte, []int)

func (*TestRequest) GetArgs

func (m *TestRequest) GetArgs() map[string]string

func (*TestRequest) GetSuite

func (m *TestRequest) GetSuite() string

func (*TestRequest) GetTests

func (m *TestRequest) GetTests() []string

func (*TestRequest) Marshal

func (m *TestRequest) Marshal() (dAtA []byte, err error)

func (*TestRequest) MarshalTo

func (m *TestRequest) MarshalTo(dAtA []byte) (int, error)

func (*TestRequest) MarshalToSizedBuffer

func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestRequest) ProtoMessage

func (*TestRequest) ProtoMessage()

func (*TestRequest) Reset

func (m *TestRequest) Reset()

func (*TestRequest) Size

func (m *TestRequest) Size() (n int)

func (*TestRequest) String

func (m *TestRequest) String() string

func (*TestRequest) Unmarshal

func (m *TestRequest) Unmarshal(dAtA []byte) error

func (*TestRequest) XXX_DiscardUnknown

func (m *TestRequest) XXX_DiscardUnknown()

func (*TestRequest) XXX_Marshal

func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TestRequest) XXX_Merge

func (m *TestRequest) XXX_Merge(src proto.Message)

func (*TestRequest) XXX_Size

func (m *TestRequest) XXX_Size() int

func (*TestRequest) XXX_Unmarshal

func (m *TestRequest) XXX_Unmarshal(b []byte) error

type TestResponse

type TestResponse struct {
}

TestResponse is a test response

func (*TestResponse) Descriptor

func (*TestResponse) Descriptor() ([]byte, []int)

func (*TestResponse) Marshal

func (m *TestResponse) Marshal() (dAtA []byte, err error)

func (*TestResponse) MarshalTo

func (m *TestResponse) MarshalTo(dAtA []byte) (int, error)

func (*TestResponse) MarshalToSizedBuffer

func (m *TestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestResponse) ProtoMessage

func (*TestResponse) ProtoMessage()

func (*TestResponse) Reset

func (m *TestResponse) Reset()

func (*TestResponse) Size

func (m *TestResponse) Size() (n int)

func (*TestResponse) String

func (m *TestResponse) String() string

func (*TestResponse) Unmarshal

func (m *TestResponse) Unmarshal(dAtA []byte) error

func (*TestResponse) XXX_DiscardUnknown

func (m *TestResponse) XXX_DiscardUnknown()

func (*TestResponse) XXX_Marshal

func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TestResponse) XXX_Merge

func (m *TestResponse) XXX_Merge(src proto.Message)

func (*TestResponse) XXX_Size

func (m *TestResponse) XXX_Size() int

func (*TestResponse) XXX_Unmarshal

func (m *TestResponse) XXX_Unmarshal(b []byte) error

type TestingSuite

type TestingSuite interface{}

TestingSuite is a suite of tests

type UnimplementedWorkerServiceServer

type UnimplementedWorkerServiceServer struct {
}

UnimplementedWorkerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedWorkerServiceServer) RunTests

type Worker

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

Worker runs a test job

func (*Worker) Run

func (w *Worker) Run() error

Run runs a benchmark

func (*Worker) RunTests

func (w *Worker) RunTests(ctx context.Context, request *TestRequest) (*TestResponse, error)

RunTests runs a suite of tests

type WorkerServiceClient

type WorkerServiceClient interface {
	RunTests(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
}

WorkerServiceClient is the client API for WorkerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewWorkerServiceClient

func NewWorkerServiceClient(cc *grpc.ClientConn) WorkerServiceClient

type WorkerServiceServer

type WorkerServiceServer interface {
	RunTests(context.Context, *TestRequest) (*TestResponse, error)
}

WorkerServiceServer is the server API for WorkerService service.

type WorkerTask

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

WorkerTask manages a single test job for a test worker

func (*WorkerTask) Run

func (t *WorkerTask) Run() (int, error)

Run runs the worker job

Jump to

Keyboard shortcuts

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