mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
## What changed? Implement DeleteExecution method in CHASM engine. ## Why? Support explicit deletion of CHASM executions. When this is called, the execution is terminated if still running. If the execution is still running, the current transaction's visibility task will be skipped and will immediately follow with DeleteExecutionVisibilityTask. If already terminated, CloseExecutionVisibilityTaskID will be updated with the latest CHASM visibility task ID. Reuses DeleteExecutionTask to delete execution info. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [X] added new functional test(s)
167 lines
6.3 KiB
Go
167 lines
6.3 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: engine.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package chasm -source engine.go -destination engine_mock.go
|
|
//
|
|
|
|
// Package chasm is a generated GoMock package.
|
|
package chasm
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockEngine is a mock of Engine interface.
|
|
type MockEngine struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockEngineMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockEngineMockRecorder is the mock recorder for MockEngine.
|
|
type MockEngineMockRecorder struct {
|
|
mock *MockEngine
|
|
}
|
|
|
|
// NewMockEngine creates a new mock instance.
|
|
func NewMockEngine(ctrl *gomock.Controller) *MockEngine {
|
|
mock := &MockEngine{ctrl: ctrl}
|
|
mock.recorder = &MockEngineMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockEngine) EXPECT() *MockEngineMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// DeleteExecution mocks base method.
|
|
func (m *MockEngine) DeleteExecution(arg0 context.Context, arg1 ComponentRef, arg2 DeleteExecutionRequest) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DeleteExecution", arg0, arg1, arg2)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// DeleteExecution indicates an expected call of DeleteExecution.
|
|
func (mr *MockEngineMockRecorder) DeleteExecution(arg0, arg1, arg2 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteExecution", reflect.TypeOf((*MockEngine)(nil).DeleteExecution), arg0, arg1, arg2)
|
|
}
|
|
|
|
// NotifyExecution mocks base method.
|
|
func (m *MockEngine) NotifyExecution(arg0 ExecutionKey) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "NotifyExecution", arg0)
|
|
}
|
|
|
|
// NotifyExecution indicates an expected call of NotifyExecution.
|
|
func (mr *MockEngineMockRecorder) NotifyExecution(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyExecution", reflect.TypeOf((*MockEngine)(nil).NotifyExecution), arg0)
|
|
}
|
|
|
|
// PollComponent mocks base method.
|
|
func (m *MockEngine) PollComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component, *Registry) (bool, error), arg3 ...TransitionOption) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "PollComponent", varargs...)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// PollComponent indicates an expected call of PollComponent.
|
|
func (mr *MockEngineMockRecorder) PollComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollComponent", reflect.TypeOf((*MockEngine)(nil).PollComponent), varargs...)
|
|
}
|
|
|
|
// ReadComponent mocks base method.
|
|
func (m *MockEngine) ReadComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component, *Registry) error, arg3 ...TransitionOption) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReadComponent", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ReadComponent indicates an expected call of ReadComponent.
|
|
func (mr *MockEngineMockRecorder) ReadComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadComponent", reflect.TypeOf((*MockEngine)(nil).ReadComponent), varargs...)
|
|
}
|
|
|
|
// StartExecution mocks base method.
|
|
func (m *MockEngine) StartExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext, ArchetypeID, *Registry) (RootComponent, error), arg3 ...TransitionOption) (StartExecutionResult, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "StartExecution", varargs...)
|
|
ret0, _ := ret[0].(StartExecutionResult)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// StartExecution indicates an expected call of StartExecution.
|
|
func (mr *MockEngineMockRecorder) StartExecution(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartExecution", reflect.TypeOf((*MockEngine)(nil).StartExecution), varargs...)
|
|
}
|
|
|
|
// UpdateComponent mocks base method.
|
|
func (m *MockEngine) UpdateComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext, Component, *Registry) error, arg3 ...TransitionOption) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "UpdateComponent", varargs...)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateComponent indicates an expected call of UpdateComponent.
|
|
func (mr *MockEngineMockRecorder) UpdateComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateComponent", reflect.TypeOf((*MockEngine)(nil).UpdateComponent), varargs...)
|
|
}
|
|
|
|
// UpdateWithStartExecution mocks base method.
|
|
func (m *MockEngine) UpdateWithStartExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext, ArchetypeID, *Registry) (RootComponent, error), arg3 func(MutableContext, Component, *Registry) error, arg4 ...TransitionOption) (EngineUpdateWithStartExecutionResult, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2, arg3}
|
|
for _, a := range arg4 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "UpdateWithStartExecution", varargs...)
|
|
ret0, _ := ret[0].(EngineUpdateWithStartExecutionResult)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateWithStartExecution indicates an expected call of UpdateWithStartExecution.
|
|
func (mr *MockEngineMockRecorder) UpdateWithStartExecution(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWithStartExecution", reflect.TypeOf((*MockEngine)(nil).UpdateWithStartExecution), varargs...)
|
|
}
|