Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMockEnv ¶
WithMockEnv sets up a MockEnv structure, passes it to the provided callback, then cleans up everything in the environment, regardless of if an assertion fails.
func WithRealEnv ¶
WithRealEnv constructs a MockEnv, then forwards all API calls to go to API server instances for supported operations. PPS requires a kubernetes environment in order to spin up pipelines, which is not yet supported by this package, but the other API servers work.
Types ¶
type MockEnv ¶
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.
type MockPachd ¶
type MockPachd struct { Addr net.Addr Object mockObjectServer PFS mockPFSServer PPS mockPPSServer Auth mockAuthServer Transaction mockTransactionServer Enterprise mockEnterpriseServer Version mockVersionServer Admin mockAdminServer // 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 ¶
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.
type RealEnv ¶
type RealEnv struct { MockEnv AuthServer authserver.APIServer PFSBlockServer pfsserver.BlockAPIServer PFSServer pfsserver.APIServer TransactionServer txnserver.APIServer // contains filtered or unexported fields }
RealEnv contains a setup for running end-to-end pachyderm tests locally. It includes the base MockEnv struct as well as a real instance of the API server. These calls can still be mocked, but they default to calling into the real server endpoints.