testpachd

package
v2.6.0-nightly.20230501 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddlewareInterceptor

func AuthMiddlewareInterceptor(mock *MockPachd) grpcutil.Interceptor

Types

type InterceptorOption

type InterceptorOption func(mock *MockPachd) grpcutil.Interceptor

type MockEnv

type MockEnv struct {
	testetcd.Env
	MockPachd  *MockPachd
	PachClient *client.APIClient
}

MockEnv contains the basic setup for running end-to-end pachyderm tests entirely locally within the test process. It provides a temporary directory for storing data, an embedded etcd server with a connected client, as well as a local mock pachd instance which allows a test to hook into any pachd calls.

func NewMockEnv

func NewMockEnv(rctx context.Context, t testing.TB, options ...InterceptorOption) *MockEnv

NewMockEnv constructs a MockEnv for testing, which will be destroyed at the end of the test.

type MockPPSJobFinisher

type MockPPSJobFinisher struct{}

func (*MockPPSJobFinisher) FinishJob

func (mpp *MockPPSJobFinisher) FinishJob(*pfs.CommitInfo)

func (*MockPPSJobFinisher) Run

func (mpp *MockPPSJobFinisher) Run() error

type MockPPSJobStopper

type MockPPSJobStopper struct{}

func (*MockPPSJobStopper) Run

func (mpp *MockPPSJobStopper) Run() error

func (*MockPPSJobStopper) StopJobs

func (mpp *MockPPSJobStopper) StopJobs(*pfs.CommitSet)

type MockPPSPropagater

type MockPPSPropagater struct{}

func (*MockPPSPropagater) PropagateJobs

func (mpp *MockPPSPropagater) PropagateJobs()

func (*MockPPSPropagater) Run

func (mpp *MockPPSPropagater) Run() error

type MockPPSTransactionServer

type MockPPSTransactionServer struct {
	Api                          ppsTransactionAPI
	NewPropagater                mockNewPropagater
	NewJobStopper                mockNewJobStopper
	NewJobFinisher               mockNewJobFinisher
	StopJobInTransaction         mockStopJobInTransaction
	UpdateJobStateInTransaction  mockUpdateJobStateInTransaction
	CreatePipelineInTransaction  mockCreatePipelineInTransaction
	InspectPipelineInTransaction mockInspectPipelineInTransaction
	ActivateAuthInTransaction    mockActivateAuthInTransaction
}

MockPPSTransactionServer provides a mocking interface for overriding PPS behavior inside transactions.

func NewMockPPSTransactionServer

func NewMockPPSTransactionServer() *MockPPSTransactionServer

NewMockPPSTransactionServer instantiates a MockPPSTransactionServer

type MockPachd

type MockPachd struct {
	Addr net.Addr

	PFS           mockPFSServer
	PPS           mockPPSServer
	Auth          mockAuthServer
	GetAuthServer func() authserver.APIServer
	Transaction   mockTransactionServer
	Identity      mockIdentityServer
	Enterprise    mockEnterpriseServer
	License       mockLicenseServer
	Version       mockVersionServer
	Admin         mockAdminServer
	Proxy         mockProxyServer
	// contains filtered or unexported fields
}

MockPachd provides an interface for running the interface for a Pachd API server locally without any of its dependencies. Tests may mock out specific API calls by providing a handler function, and later check information about the mocked calls.

func NewMockPachd

func NewMockPachd(ctx context.Context, port uint16, options ...InterceptorOption) (*MockPachd, error)

NewMockPachd constructs a mock Pachd API server whose behavior can be controlled through the MockPachd instance. By default, all API calls will error, unless a handler is specified. A port value of 0 will choose a free port automatically options can be supplied to configure the grpcutil.Server's interceptors.

func (*MockPachd) Close

func (mock *MockPachd) Close() error

Close will cancel the mock Pachd API server goroutine and return its result

func (*MockPachd) Err

func (mock *MockPachd) Err() <-chan error

Err returns a read-only channel that will receive the first error that occurs in the server group (stopping all the servers).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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