Documentation ¶
Index ¶
- Variables
- func CreateESClient(s suite.Suite, url string, version string) client.IntegrationTestsClient
- func CreateIndex(s suite.Suite, esClient client.IntegrationTestsClient, indexName string)
- func DeleteIndex(s suite.Suite, esClient client.IntegrationTestsClient, indexName string)
- func NewContext() context.Context
- func NewFrontendClient(connection *grpc.ClientConn) workflowservice.WorkflowServiceClient
- func PutIndexTemplate(s suite.Suite, esClient client.IntegrationTestsClient, ...)
- type AdminClient
- type ArchiverBase
- type FrontendClient
- type HistoryClient
- type HistoryConfig
- type IntegrationBase
- type TaskPoller
- func (p *TaskPoller) HandlePartialWorkflowTask(response *workflowservice.PollWorkflowTaskQueueResponse) (*workflowservice.RespondWorkflowTaskCompletedResponse, error)
- func (p *TaskPoller) PollAndProcessActivityTask(dropTask bool) error
- func (p *TaskPoller) PollAndProcessActivityTaskWithID(dropTask bool) error
- func (p *TaskPoller) PollAndProcessWorkflowTask(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttempt(dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, ...) (isQueryTask bool, err error)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetry(dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, ...) (isQueryTask bool, err error)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetryAndForceNewWorkflowTask(dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, ...) (isQueryTask bool, ...)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithSticky(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithoutRetry(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
- type Temporal
- type TemporalParams
- type TestCluster
- type TestClusterConfig
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
var TestFlags struct { FrontendAddr string PersistenceType string PersistenceDriver string TestClusterConfigFile string }
TestFlags contains the feature flags for integration tests
Functions ¶
func CreateESClient ¶ added in v0.5.9
CreateESClient create ElasticSearch client for test
func CreateIndex ¶ added in v0.5.9
func CreateIndex(s suite.Suite, esClient client.IntegrationTestsClient, indexName string)
CreateIndex create test index
func DeleteIndex ¶ added in v0.5.9
func DeleteIndex(s suite.Suite, esClient client.IntegrationTestsClient, indexName string)
DeleteIndex delete test index
func NewContext ¶ added in v0.27.0
NewContext create new context with default timeout 90 seconds.
func NewFrontendClient ¶ added in v0.5.0
func NewFrontendClient(connection *grpc.ClientConn) workflowservice.WorkflowServiceClient
NewFrontendClient creates a client to temporal frontend client
func PutIndexTemplate ¶ added in v0.5.9
func PutIndexTemplate(s suite.Suite, esClient client.IntegrationTestsClient, templateConfigFile, templateName string)
PutIndexTemplate put index template for test
Types ¶
type AdminClient ¶ added in v0.5.0
type AdminClient interface { adminservice.AdminServiceClient }
AdminClient is the interface exposed by admin service client
func NewAdminClient ¶ added in v0.5.0
func NewAdminClient(connection *grpc.ClientConn) AdminClient
NewAdminClient creates a client to temporal admin client
type ArchiverBase ¶ added in v0.7.0
type ArchiverBase struct {
// contains filtered or unexported fields
}
ArchiverBase is a base struct for archiver provider being used in integration tests
type FrontendClient ¶ added in v0.5.0
type FrontendClient interface { workflowservice.WorkflowServiceClient }
FrontendClient is the interface exposed by frontend service client
type HistoryClient ¶ added in v0.27.0
type HistoryClient interface { historyservice.HistoryServiceClient }
HistoryClient is the interface exposed by history service client
func NewHistoryClient ¶ added in v0.27.0
func NewHistoryClient(connection *grpc.ClientConn) HistoryClient
NewHistoryClient creates a client to temporal history service client
type HistoryConfig ¶ added in v0.5.7
type HistoryConfig struct { NumHistoryShards int32 NumHistoryHosts int HistoryCountLimitError int HistoryCountLimitWarn int }
HistoryConfig contains configs for history service
type IntegrationBase ¶ added in v0.4.0
type IntegrationBase struct { suite.Suite Logger log.Logger // contains filtered or unexported fields }
IntegrationBase is a base struct for integration tests
type TaskPoller ¶ added in v0.4.0
type TaskPoller struct { Engine FrontendClient Namespace string TaskQueue *taskqueuepb.TaskQueue StickyTaskQueue *taskqueuepb.TaskQueue StickyScheduleToStartTimeout time.Duration Identity string WorkflowTaskHandler workflowTaskHandler ActivityTaskHandler activityTaskHandler QueryHandler queryHandler Logger log.Logger T *testing.T }
TaskPoller is used in integration tests to poll workflow or activity task queues.
func (*TaskPoller) HandlePartialWorkflowTask ¶ added in v0.27.0
func (p *TaskPoller) HandlePartialWorkflowTask(response *workflowservice.PollWorkflowTaskQueueResponse) ( *workflowservice.RespondWorkflowTaskCompletedResponse, error)
HandlePartialWorkflowTask for workflow task
func (*TaskPoller) PollAndProcessActivityTask ¶ added in v0.4.0
func (p *TaskPoller) PollAndProcessActivityTask(dropTask bool) error
PollAndProcessActivityTask for activity tasks
func (*TaskPoller) PollAndProcessActivityTaskWithID ¶ added in v0.4.0
func (p *TaskPoller) PollAndProcessActivityTaskWithID(dropTask bool) error
PollAndProcessActivityTaskWithID is similar to PollAndProcessActivityTask but using RespondActivityTask...ByID
func (*TaskPoller) PollAndProcessWorkflowTask ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTask(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
PollAndProcessWorkflowTask for workflow tasks
func (*TaskPoller) PollAndProcessWorkflowTaskWithAttempt ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttempt( dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, respondStickyTaskQueue bool, workflowTaskAttempt int32, ) (isQueryTask bool, err error)
PollAndProcessWorkflowTaskWithAttempt for workflow tasks
func (*TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetry ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetry( dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, respondStickyTaskQueue bool, workflowTaskAttempt int32, retryCount int, ) (isQueryTask bool, err error)
PollAndProcessWorkflowTaskWithAttemptAndRetry for workflow tasks
func (*TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetryAndForceNewWorkflowTask ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTaskWithAttemptAndRetryAndForceNewWorkflowTask( dumpHistory bool, dropTask bool, pollStickyTaskQueue bool, respondStickyTaskQueue bool, workflowTaskAttempt int32, retryCount int, forceCreateNewWorkflowTask bool, queryResult *querypb.WorkflowQueryResult, ) (isQueryTask bool, newTask *workflowservice.RespondWorkflowTaskCompletedResponse, err error)
PollAndProcessWorkflowTaskWithAttemptAndRetryAndForceNewWorkflowTask for workflow tasks
func (*TaskPoller) PollAndProcessWorkflowTaskWithSticky ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTaskWithSticky(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
PollAndProcessWorkflowTaskWithSticky for workflow tasks
func (*TaskPoller) PollAndProcessWorkflowTaskWithoutRetry ¶ added in v0.27.0
func (p *TaskPoller) PollAndProcessWorkflowTaskWithoutRetry(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)
PollAndProcessWorkflowTaskWithoutRetry for workflow tasks
type Temporal ¶ added in v0.27.0
type Temporal interface { Start() error Stop() GetAdminClient() adminservice.AdminServiceClient GetFrontendClient() workflowservice.WorkflowServiceClient GetHistoryClient() historyservice.HistoryServiceClient GetExecutionManagerFactory() persistence.ExecutionManagerFactory }
Temporal hosts all of temporal services in one process
func NewTemporal ¶ added in v0.27.0
func NewTemporal(params *TemporalParams) Temporal
NewTemporal returns an instance that hosts full temporal in one process
type TemporalParams ¶ added in v0.27.0
type TemporalParams struct { ClusterMetadataConfig *config.ClusterMetadata PersistenceConfig config.Persistence MetadataMgr persistence.MetadataManager ClusterMetadataManager persistence.ClusterMetadataManager ShardMgr persistence.ShardManager HistoryV2Mgr persistence.HistoryManager ExecutionMgrFactory persistence.ExecutionManagerFactory TaskMgr persistence.TaskManager VisibilityMgr persistence.VisibilityManager NamespaceReplicationQueue persistence.NamespaceReplicationQueue Logger log.Logger ClusterNo int ArchiverMetadata carchiver.ArchivalMetadata ArchiverProvider provider.ArchiverProvider EnableReadHistoryFromArchival bool HistoryConfig *HistoryConfig ESConfig *config.Elasticsearch ESClient client.Client WorkerConfig *WorkerConfig MockAdminClient map[string]adminservice.AdminServiceClient NamespaceReplicationTaskExecutor namespace.ReplicationTaskExecutor }
TemporalParams contains everything needed to bootstrap Temporal
type TestCluster ¶ added in v0.5.7
type TestCluster struct {
// contains filtered or unexported fields
}
TestCluster is a base struct for integration tests
func NewCluster ¶ added in v0.5.7
func NewCluster(options *TestClusterConfig, logger log.Logger) (*TestCluster, error)
NewCluster creates and sets up the test cluster
func (*TestCluster) GetAdminClient ¶ added in v0.5.7
func (tc *TestCluster) GetAdminClient() AdminClient
GetAdminClient returns an admin client from the test cluster
func (*TestCluster) GetExecutionManagerFactory ¶ added in v0.27.0
func (tc *TestCluster) GetExecutionManagerFactory() persistence.ExecutionManagerFactory
GetExecutionManagerFactory returns an execution manager factory from the test cluster
func (*TestCluster) GetFrontendClient ¶ added in v0.5.7
func (tc *TestCluster) GetFrontendClient() FrontendClient
GetFrontendClient returns a frontend client from the test cluster
func (*TestCluster) GetHistoryClient ¶ added in v0.27.0
func (tc *TestCluster) GetHistoryClient() HistoryClient
GetHistoryClient returns a history client from the test cluster
func (*TestCluster) TearDownCluster ¶ added in v0.5.7
func (tc *TestCluster) TearDownCluster()
TearDownCluster tears down the test cluster
type TestClusterConfig ¶ added in v0.5.7
type TestClusterConfig struct { FrontendAddress string EnableArchival bool IsMasterCluster bool ClusterNo int ClusterMetadata config.ClusterMetadata Persistence persistencetests.TestBaseOptions HistoryConfig *HistoryConfig ESConfig *config.Elasticsearch WorkerConfig *WorkerConfig MockAdminClient map[string]adminservice.AdminServiceClient }
TestClusterConfig are config for a test cluster
func GetTestClusterConfig ¶ added in v0.5.7
func GetTestClusterConfig(configFile string) (*TestClusterConfig, error)
GetTestClusterConfig return test cluster config
type WorkerConfig ¶ added in v0.5.7
WorkerConfig is the config for enabling/disabling Temporal worker