Documentation ¶
Index ¶
- Constants
- func Register(group, name string, fn func(*T), desc string)
- type BucketRef
- type Check
- type ClusterRef
- type CollectionRef
- type KVHook
- type KvExpect
- func (e KvExpect) BucketName(name string) *KvExpect
- func (e KvExpect) Cmd(cmd memd.CmdCode) *KvExpect
- func (e KvExpect) CollectionID(id uint32) *KvExpect
- func (e KvExpect) CollectionName(name string) *KvExpect
- func (e KvExpect) Custom(chkFn func(mock.KvClient, *memd.Packet) bool) *KvExpect
- func (e KvExpect) Key(key string) *KvExpect
- func (e KvExpect) KeyBytes(key []byte) *KvExpect
- func (e KvExpect) Magic(magic memd.CmdMagic) *KvExpect
- func (e KvExpect) Opaque(opaque uint32) *KvExpect
- func (e KvExpect) ReplyTo(source mock.KvClient, pak *memd.Packet) *KvExpect
- func (e KvExpect) ScopeName(name string) *KvExpect
- func (e KvExpect) Source(cli mock.KvClient) *KvExpect
- func (e KvExpect) String() string
- func (e KvExpect) Wait() (mock.KvClient, *memd.Packet)
- type RecordedPacket
- type ScopeRef
- type T
- func (t *T) Bucket() BucketRef
- func (t *T) Cluster() ClusterRef
- func (t *T) Collection() CollectionRef
- func (t *T) End(result interface{})
- func (t *T) Errorf(format string, args ...interface{})
- func (t *T) Fail()
- func (t *T) FailNow()
- func (t *T) Fatalf(format string, args ...interface{})
- func (t *T) Logf(format string, args ...interface{})
- func (t *T) Mock() mock.Cluster
- func (t *T) RequireFeature(feature TestFeature)
- func (t *T) RequireMock()
- func (t *T) Scope() ScopeRef
- func (t *T) SetBucket(name string)
- func (t *T) Start() (*TestStartedSpec, error)
- func (t *T) UseManagementConnString()
- type TestFeature
- type TestResult
- type TestRunner
- type TestStartedSpec
- type TestStatus
Constants ¶
const ( TestFeatureEnhancedPreparedStatements = "enhancedprepared" TestFeature3Replicas = "3replicas" TestFeatureErrMap = "errmap" )
The following is a list of all supported features.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BucketRef ¶
type BucketRef struct { Cluster ClusterRef BucketName string }
BucketRef represents a bucket within the checks system.
func (BucketRef) HookHelper ¶
func (c BucketRef) HookHelper(handler mock.KvHookFunc) KVHook
func (BucketRef) KvExpectReq ¶
KvExpectReq returns a new expectation of a kv request.
type ClusterRef ¶
type ClusterRef struct {
// contains filtered or unexported fields
}
ClusterRef represents a cluster within the checks system.
func (ClusterRef) HookHelper ¶
func (c ClusterRef) HookHelper(handler mock.KvHookFunc) KVHook
func (ClusterRef) KvExpectReq ¶
func (c ClusterRef) KvExpectReq() *KvExpect
KvExpectReq returns a new expectation of a kv request.
func (ClusterRef) KvExpectRes ¶
func (c ClusterRef) KvExpectRes() *KvExpect
KvExpectReq returns a new expectation of a kv response.
type CollectionRef ¶
CollectionRef represents a collection within the checks system.
func (CollectionRef) HookHelper ¶
func (c CollectionRef) HookHelper(handler mock.KvHookFunc) KVHook
func (CollectionRef) KvExpectReq ¶
func (c CollectionRef) KvExpectReq() *KvExpect
KvExpectReq returns a new expectation of a kv request.
type KVHook ¶
type KVHook struct {
// contains filtered or unexported fields
}
func (KVHook) Build ¶
func (hook KVHook) Build() mock.KvHookFunc
type KvExpect ¶
type KvExpect struct {
// contains filtered or unexported fields
}
KvExpect represents a Kv expectation.
func (KvExpect) BucketName ¶
BucketName specifies a specific bucket name which is expected.
func (KvExpect) CollectionID ¶
CollectionID specifies a specific collection id which is expected.
func (KvExpect) CollectionName ¶
CollectionName specifies a specific collection name which is expected.
type RecordedPacket ¶
type ScopeRef ¶
ScopeRef represents a scope within the checks system.
func (ScopeRef) HookHelper ¶
func (c ScopeRef) HookHelper(handler mock.KvHookFunc) KVHook
func (ScopeRef) KvExpectReq ¶
KvExpectReq returns a new expectation of a kv request.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents a singular check test that is being run.
func (*T) Cluster ¶
func (t *T) Cluster() ClusterRef
Cluster returns a reference to the cluster associated with this check.
func (*T) Collection ¶
func (t *T) Collection() CollectionRef
Collection returns a reference to the collection associated with this check.
func (*T) FailNow ¶
func (t *T) FailNow()
FailNow mark this check as having failed and immediately bails out of the check.
func (*T) RequireFeature ¶
func (t *T) RequireFeature(feature TestFeature)
RequireFeature marks a feature as required by this check.
func (*T) RequireMock ¶
func (t *T) RequireMock()
RequireMock marks this check as requiring a non default cluster instance.
func (*T) Start ¶
func (t *T) Start() (*TestStartedSpec, error)
Start will start a test and wait till it is configured.
func (*T) UseManagementConnString ¶
func (t *T) UseManagementConnString()
type TestFeature ¶
type TestFeature string
TestFeature represents a feature that may be required by a test.
type TestResult ¶
type TestResult struct { Name string Description string Status TestStatus Logs []string Packets []*RecordedPacket }
TestResult represents the result of a test.
type TestRunner ¶
type TestRunner struct {
// contains filtered or unexported fields
}
TestRunner represents a single run of all tests.
func NewTestRunner ¶
func NewTestRunner() (*TestRunner, error)
NewTestRunner creates a new test run group for running tests.
func (*TestRunner) DefaultCluster ¶
func (g *TestRunner) DefaultCluster() mock.Cluster
DefaultCluster returns the default cluster associated with this test run.
func (*TestRunner) End ¶
func (g *TestRunner) End()
End will end any currently running test, then the whole test group.
func (*TestRunner) EndRunningTest ¶
func (g *TestRunner) EndRunningTest(result interface{}) error
EndRunningTest will end whatever test is currently running.
func (*TestRunner) Results ¶
func (g *TestRunner) Results() []*TestResult
Results returns the results of this test run once it has ended.
func (*TestRunner) StartTest ¶
func (g *TestRunner) StartTest(name string) (*TestStartedSpec, error)
StartTest will begin a test by name.
type TestStartedSpec ¶
type TestStartedSpec struct { Connstr string BucketName string ScopeName string CollectionName string }
TestStartedSpec represents all the information needed to run a test.
type TestStatus ¶
type TestStatus int
const ( TestStatusUnknown TestStatus = iota TestStatusSkipped TestStatusSuccess TestStatusFailed )