Documentation ¶
Index ¶
Constants ¶
const ( InvokeOperation = "call" ReturnOperation = "return" )
Operation action
Variables ¶
This section is empty.
Functions ¶
func RunE2ETests ¶
RunE2ETests checks configuration parameters (specified through flags) and then runs E2E tests using the Ginkgo runner. If a "report directory" is specified, one or more JUnit test reports will be generated in this directory, and cluster logs will also be saved. This function is called on each Ginkgo node in parallel mode.
Types ¶
type Checker ¶
type Checker interface { // Check a series of operations with the given model. // Return false or error if operations do not satisfy the model. Check(m Model, ops []Operation) (bool, error) // Name returns the unique name for the checker. Name() string }
Checker checks a history of operations.
type Client ¶
type Client interface { // SetUp sets up the client. SetUp(ctx context.Context, nodes []string, node string) error // TearDown tears down the client. TearDown(ctx context.Context, nodes []string, node string) error // Invoke invokes a request to the database. // Mostly, the return Response should implement UnknownResponse interface Invoke(ctx context.Context, node string, r interface{}) interface{} // NextRequest generates a request for latter Invoke. NextRequest() interface{} // DumpState the database state(also the model's state) DumpState(ctx context.Context) (interface{}, error) }
Client applies the request to the database. Client is used in control. You should define your own client for your database.
type ClientCreator ¶
ClientCreator creates a client. The control will create one client for one node.
type Model ¶
type Model interface { // Prepare the initial state of the data object. Prepare(state interface{}) // Initial state of the data object. Init() interface{} // Step function for the data object. Returns whether or not the system // could take this step with the given inputs and outputs and also // returns the new state. This should not mutate the existing state. // // state must support encoding to and decoding from json. Step(state interface{}, input interface{}, output interface{}) (bool, interface{}) // Equality on states. Equal(state1, state2 interface{}) bool // Name returns the unique name for the model. Name() string }
Model specifies the behavior of a data object.
type NoopChecker ¶
type NoopChecker struct{}
NoopChecker is a noop checker.
type NoopClientCreator ¶
type NoopClientCreator struct { }
NoopClientCreator creates a noop client.
func (NoopClientCreator) Create ¶
func (NoopClientCreator) Create(node string) Client
Create creates the client.
type NoopModel ¶
type NoopModel struct {
// contains filtered or unexported fields
}
NoopModel is noop model.
func (*NoopModel) Init ¶
func (n *NoopModel) Init() interface{}
Init initials state of the data object.
type Operation ¶
type Operation struct { Action string `json:"action"` Proc int64 `json:"proc"` Data interface{} `json:"data"` }
Operation of a data object.
type UnknownResponse ¶
type UnknownResponse interface {
IsUnknown() bool
}
UnknownResponse means we don't know weather this operation succeeds or not.