Documentation
¶
Overview ¶
Package testkitmodule provides the compiled-in "testkit" AutoFlow module for generated test flows: deterministic actions whose side effects the flowtest oracle can verify against the session ledger. It is deliberately not part of the production internal/module/autoflow/builtin_modules set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_internal_tool_testing_flowtest_testkitmodule_params_proto protoreflect.FileDescriptor
Functions ¶
func New ¶
func New(validator protovalidate.Validator, store LedgerStore) pkg_autoflow.Module
New returns the testkit module, which gives generated test flows deterministic actions:
load("module:testkit", "echo", "delay", "record", "counter")
def main(w):
gather(echo("x"), delay(50), record("<session-uuid>:token-1"))
counter("<session-uuid>:attempts")
echo returns its argument unchanged, delay sleeps server-side for the given milliseconds (capped by the params validation) and returns them, record lands its generator-unique token in the ledger's tokens table with the token as the destination dedup key, and counter increments a ledger counter and returns its new value.
A nil store means the process runs without a ledger: echo and delay still work, while record fails visibly rather than silently dropping its token, which the oracle would misread as a lost side effect, and counter fails rather than returning a value no ledger backs.
Types ¶
type CounterParams ¶
type CounterParams struct {
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*CounterParams) Descriptor
deprecated
func (*CounterParams) Descriptor() ([]byte, []int)
Deprecated: Use CounterParams.ProtoReflect.Descriptor instead.
func (*CounterParams) GetKey ¶
func (x *CounterParams) GetKey() string
func (*CounterParams) ProtoMessage ¶
func (*CounterParams) ProtoMessage()
func (*CounterParams) ProtoReflect ¶
func (x *CounterParams) ProtoReflect() protoreflect.Message
func (*CounterParams) Reset ¶
func (x *CounterParams) Reset()
func (*CounterParams) String ¶
func (x *CounterParams) String() string
type DelayParams ¶
type DelayParams struct {
Ms *int64 `protobuf:"varint,1,opt,name=ms" json:"ms,omitempty"`
// contains filtered or unexported fields
}
func (*DelayParams) Descriptor
deprecated
func (*DelayParams) Descriptor() ([]byte, []int)
Deprecated: Use DelayParams.ProtoReflect.Descriptor instead.
func (*DelayParams) GetMs ¶
func (x *DelayParams) GetMs() int64
func (*DelayParams) ProtoMessage ¶
func (*DelayParams) ProtoMessage()
func (*DelayParams) ProtoReflect ¶
func (x *DelayParams) ProtoReflect() protoreflect.Message
func (*DelayParams) Reset ¶
func (x *DelayParams) Reset()
func (*DelayParams) String ¶
func (x *DelayParams) String() string
type EchoParams ¶
type EchoParams struct {
Value *v19.Value `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*EchoParams) Descriptor
deprecated
func (*EchoParams) Descriptor() ([]byte, []int)
Deprecated: Use EchoParams.ProtoReflect.Descriptor instead.
func (*EchoParams) GetValue ¶
func (x *EchoParams) GetValue() *v19.Value
func (*EchoParams) ProtoMessage ¶
func (*EchoParams) ProtoMessage()
func (*EchoParams) ProtoReflect ¶
func (x *EchoParams) ProtoReflect() protoreflect.Message
func (*EchoParams) Reset ¶
func (x *EchoParams) Reset()
func (*EchoParams) String ¶
func (x *EchoParams) String() string
type LedgerStore ¶
type LedgerStore interface {
RecordToken(ctx context.Context, sessionID uuid.UUID, token string) error
IncrementCounter(ctx context.Context, key string) (int64, error)
}
LedgerStore is the ledger surface the testkit actions write to; *ledger.Store implements it.
type RecordParams ¶
type RecordParams struct {
Token *string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
// contains filtered or unexported fields
}
func (*RecordParams) Descriptor
deprecated
func (*RecordParams) Descriptor() ([]byte, []int)
Deprecated: Use RecordParams.ProtoReflect.Descriptor instead.
func (*RecordParams) GetToken ¶
func (x *RecordParams) GetToken() string
func (*RecordParams) ProtoMessage ¶
func (*RecordParams) ProtoMessage()
func (*RecordParams) ProtoReflect ¶
func (x *RecordParams) ProtoReflect() protoreflect.Message
func (*RecordParams) Reset ¶
func (x *RecordParams) Reset()
func (*RecordParams) String ¶
func (x *RecordParams) String() string