package integration
import "github.com/google/trillian/testonly/integration"
Package integration provides test-only code for performing integrated tests of Trillian functionality.
Index ¶
- Variables
- func NewRegistryForTests(ctx context.Context) (extension.Registry, func(context.Context), error)
- type LogEnv
- func NewLogEnv(ctx context.Context, numSequencers int, _ string) (*LogEnv, error)
- func NewLogEnvWithGRPCOptions(ctx context.Context, numSequencers int, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)
- func NewLogEnvWithRegistry(ctx context.Context, numSequencers int, registry extension.Registry) (*LogEnv, error)
- func NewLogEnvWithRegistryAndGRPCOptions(ctx context.Context, numSequencers int, registry extension.Registry, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)
- func (env *LogEnv) Close()
Variables ¶
var ( // SequencerInterval is the time between runs of the sequencer. SequencerInterval = 500 * time.Millisecond )
Functions ¶
func NewRegistryForTests ¶
NewRegistryForTests returns an extension.Registry for integration tests. Callers should call the returned cleanup function when they're finished with the registry and its contents.
Types ¶
type LogEnv ¶
type LogEnv struct { LogOperation log.Operation Sequencer *log.OperationManager ClientConn *grpc.ClientConn // TODO(gbelvin): Deprecate. Address string Log trillian.TrillianLogClient Admin trillian.TrillianAdminClient DB *sql.DB // contains filtered or unexported fields }
LogEnv is a test environment that contains both a log server and a connection to it.
func NewLogEnv ¶
NewLogEnv creates a fresh DB, log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used.
Deprecated: Use NewLogEnvWithGRPCOptions instead
TODO(Martin2112): Remove this constructor, it is only used by tests and can be replaced by one of the others.
func NewLogEnvWithGRPCOptions ¶
func NewLogEnvWithGRPCOptions(ctx context.Context, numSequencers int, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)
NewLogEnvWithGRPCOptions creates a fresh DB, log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used. Additional grpc.ServerOption and grpc.DialOption values can be provided.
func NewLogEnvWithRegistry ¶
func NewLogEnvWithRegistry(ctx context.Context, numSequencers int, registry extension.Registry) (*LogEnv, error)
NewLogEnvWithRegistry uses the passed in Registry to create a log server, and client. The numSequencers parameter indicates how many sequencers to run in parallel; if numSequencers is zero a manually-controlled test sequencer is used.
func NewLogEnvWithRegistryAndGRPCOptions ¶
func NewLogEnvWithRegistryAndGRPCOptions(ctx context.Context, numSequencers int, registry extension.Registry, serverOpts []grpc.ServerOption, clientOpts []grpc.DialOption) (*LogEnv, error)
NewLogEnvWithRegistryAndGRPCOptions works the same way as NewLogEnv, but allows callers to also set additional grpc.ServerOption and grpc.DialOption values.
func (*LogEnv) Close ¶
func (env *LogEnv) Close()
Close shuts down the server.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
testonly/integration/etcd |
- Version
- v1.5.0
- Published
- Aug 17, 2022
- Platform
- js/wasm
- Imports
- 21 packages
- Last checked
- 5 hours ago –
Tools for package owners.