Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeString(t require.TestingT, pls *commonpb.Payloads) string
- func EventBatchesToVersionHistory(versionHistory *historyspb.VersionHistory, eventBatches []*historypb.History) (*historyspb.VersionHistory, error)
- func NewContext() context.Context
- func NewTestDataConverter() converter.DataConverter
- func RandomizeStr(id string) string
- func RandomizedNexusEndpoint(name string) string
- func UsingSQLAdvancedVisibility() bool
- func WithDropTask(o *PollAndProcessWorkflowTaskOptions)
- func WithDumpHistory(o *PollAndProcessWorkflowTaskOptions)
- func WithForceNewWorkflowTask(o *PollAndProcessWorkflowTaskOptions)
- func WithNoDumpCommands(o *PollAndProcessWorkflowTaskOptions)
- func WithPollSticky(o *PollAndProcessWorkflowTaskOptions)
- func WithRespondSticky(o *PollAndProcessWorkflowTaskOptions)
- func WithoutRetries(o *PollAndProcessWorkflowTaskOptions)
- type ActivityTaskHandler
- type AdminClient
- type ArchiverBase
- type ClientFunctionalSuite
- func (s *ClientFunctionalSuite) EventuallySucceeds(ctx context.Context, operationCtx backoff.OperationCtx)
- func (s *ClientFunctionalSuite) HistoryContainsFailureCausedBy(ctx context.Context, workflowId string, cause enumspb.WorkflowTaskFailedCause)
- func (s *ClientFunctionalSuite) SdkClient() sdkclient.Client
- func (s *ClientFunctionalSuite) SetupSuite()
- func (s *ClientFunctionalSuite) SetupTest()
- func (s *ClientFunctionalSuite) TaskQueue() string
- func (s *ClientFunctionalSuite) TearDownSuite()
- func (s *ClientFunctionalSuite) TearDownTest()
- func (s *ClientFunctionalSuite) Worker() worker.Worker
- type FrontendClient
- type FrontendConfig
- type FunctionalSuite
- type FunctionalTestBase
- func (s *FunctionalTestBase) AdminClient() AdminClient
- func (s *FunctionalTestBase) ArchivalNamespace() string
- func (s *FunctionalTestBase) DecodePayloadsByteSliceInt32(ps *commonpb.Payloads) (r int32)
- func (s *FunctionalTestBase) DecodePayloadsInt(ps *commonpb.Payloads) int
- func (s *FunctionalTestBase) DecodePayloadsString(ps *commonpb.Payloads) string
- func (s *FunctionalTestBase) DurationNear(value, target, tolerance time.Duration)
- func (s *FunctionalTestBase) ForeignNamespace() string
- func (s *FunctionalTestBase) FrontendClient() FrontendClient
- func (s *FunctionalTestBase) FrontendGRPCAddress() string
- func (s *FunctionalTestBase) GetHistory(namespace string, execution *commonpb.WorkflowExecution) []*historypb.HistoryEvent
- func (s *FunctionalTestBase) GetHistoryFunc(namespace string, execution *commonpb.WorkflowExecution) func() []*historypb.HistoryEvent
- func (s *FunctionalTestBase) GetNamespaceID(namespace string) string
- func (s *FunctionalTestBase) GetTestCluster() *TestCluster
- func (s *FunctionalTestBase) GetTestClusterConfig() *TestClusterConfig
- func (s *FunctionalTestBase) HttpAPIAddress() string
- func (s *FunctionalTestBase) Namespace() string
- func (s *FunctionalTestBase) OperatorClient() operatorservice.OperatorServiceClient
- func (s *FunctionalTestBase) OverrideDynamicConfig(setting dynamicconfig.GenericSetting, value any) (cleanup func())
- func (s *FunctionalTestBase) RunTestWithMatchingBehavior(subtest func())
- func (s *FunctionalTestBase) SetDynamicConfigOverrides(dynamicConfig map[dynamicconfig.Key]interface{})
- func (s *FunctionalTestBase) SetupSuite(defaultClusterConfigFile string, options ...Option)
- func (s *FunctionalTestBase) SetupTest()
- func (s *FunctionalTestBase) TearDownSuite()
- type FunctionalTestBaseSuite
- type HistoryClient
- type HistoryConfig
- type MatchingConfig
- type MessageHandler
- type Option
- type PersistenceTestBaseFactory
- type PollAndProcessWorkflowTaskOptionFunc
- type PollAndProcessWorkflowTaskOptions
- type PollAndProcessWorkflowTaskResponse
- type QueryHandler
- type SearchAttributeTestMapper
- type TaskPollerdeprecated
- 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(funcs ...PollAndProcessWorkflowTaskOptionFunc) (res PollAndProcessWorkflowTaskResponse, err error)
- func (p *TaskPoller) PollAndProcessWorkflowTaskWithOptions(opts *PollAndProcessWorkflowTaskOptions) (res PollAndProcessWorkflowTaskResponse, err error)
- type TemporalImpl
- func (c *TemporalImpl) AdminClient() adminservice.AdminServiceClient
- func (c *TemporalImpl) Authorize(ctx context.Context, caller *authorization.Claims, ...) (authorization.Result, error)
- func (c *TemporalImpl) CaptureMetricsHandler() *metricstest.CaptureHandler
- func (c *TemporalImpl) DcClient() *dynamicconfig.MemoryClient
- func (c *TemporalImpl) FrontendClient() workflowservice.WorkflowServiceClient
- func (c *TemporalImpl) FrontendGRPCAddress() string
- func (c *TemporalImpl) FrontendHTTPAddress() string
- func (c *TemporalImpl) FrontendNamespaceRegistries() []namespace.Registry
- func (c *TemporalImpl) GetClaims(authInfo *authorization.AuthInfo) (*authorization.Claims, error)
- func (c *TemporalImpl) GetExecutionManager() persistence.ExecutionManager
- func (c *TemporalImpl) GetMetricsHandler() metrics.Handler
- func (c *TemporalImpl) GetTLSConfigProvider() encryption.TLSConfigProvider
- func (c *TemporalImpl) GetTaskCategoryRegistry() tasks.TaskCategoryRegistry
- func (c *TemporalImpl) HistoryClient() historyservice.HistoryServiceClient
- func (c *TemporalImpl) MatchingClient() matchingservice.MatchingServiceClient
- func (c *TemporalImpl) OperatorClient() operatorservice.OperatorServiceClient
- func (c *TemporalImpl) RemoteFrontendGRPCAddress() string
- func (c *TemporalImpl) SetOnAuthorize(...)
- func (c *TemporalImpl) SetOnGetClaims(fn func(*authorization.AuthInfo) (*authorization.Claims, error))
- func (c *TemporalImpl) Start() error
- func (c *TemporalImpl) Stop() error
- func (c *TemporalImpl) TlsConfigProvider() *encryption.FixedTLSConfigProvider
- type TemporalParams
- type TestCluster
- func (tc *TestCluster) AdminClient() AdminClient
- func (tc *TestCluster) ArchivalBase() *ArchiverBase
- func (tc *TestCluster) ExecutionManager() persistence.ExecutionManager
- func (tc *TestCluster) FrontendClient() FrontendClient
- func (tc *TestCluster) HistoryClient() historyservice.HistoryServiceClient
- func (tc *TestCluster) Host() *TemporalImpl
- func (tc *TestCluster) MatchingClient() matchingservice.MatchingServiceClient
- func (tc *TestCluster) OperatorClient() operatorservice.OperatorServiceClient
- func (tc *TestCluster) OverrideDynamicConfig(t *testing.T, key dynamicconfig.GenericSetting, value any) (cleanup func())
- func (tc *TestCluster) TearDownCluster() error
- func (tc *TestCluster) TestBase() *persistencetests.TestBase
- type TestClusterConfig
- type TestClusterFactory
- type TestClusterParams
- type TestDataConverter
- func (tdc *TestDataConverter) FromPayload(payload *commonpb.Payload, valuePtr interface{}) error
- func (tdc *TestDataConverter) FromPayloads(payloads *commonpb.Payloads, valuePtrs ...interface{}) error
- func (tdc *TestDataConverter) ToPayload(value interface{}) (*commonpb.Payload, error)
- func (tdc *TestDataConverter) ToPayloads(values ...interface{}) (*commonpb.Payloads, error)
- func (tdc *TestDataConverter) ToString(payload *commonpb.Payload) string
- func (tdc *TestDataConverter) ToStrings(payloads *commonpb.Payloads) []string
- type WorkerConfig
- type WorkflowTaskHandler
Constants ¶
const ( DefaultPageSize = 5 PprofTestPort = 7000 TlsCertCommonName = "my-common-name" ClientSuiteLimit = 10 // 0x8f01 is invalid UTF-8 InvalidUTF8 = "\n\x8f\x01\n\x0ejunk\x12data" WaitForESToSettle = 4 * time.Second // wait es shards for some time ensure data consistent )
const NamespaceCacheRefreshInterval = time.Second
Variables ¶
var ( ErrEncodingIsNotSet = errors.New("payload encoding metadata is not set") ErrEncodingIsNotSupported = errors.New("payload encoding is not supported") )
var (
ErrNoTasks = errors.New("no tasks")
)
var TestFlags struct { FrontendHTTPAddr string PersistenceType string PersistenceDriver string TestClusterConfigFile string FaultInjectionConfigFile string }
TestFlags contains the feature flags for functional tests
Functions ¶
func EventBatchesToVersionHistory ¶
func EventBatchesToVersionHistory( versionHistory *historyspb.VersionHistory, eventBatches []*historypb.History, ) (*historyspb.VersionHistory, error)
func NewContext ¶
NewContext create new context with default timeout 90 seconds.
func NewTestDataConverter ¶
func NewTestDataConverter() converter.DataConverter
func RandomizeStr ¶
func RandomizedNexusEndpoint ¶
func UsingSQLAdvancedVisibility ¶
func UsingSQLAdvancedVisibility() bool
func WithDropTask ¶
func WithDropTask(o *PollAndProcessWorkflowTaskOptions)
func WithDumpHistory ¶
func WithDumpHistory(o *PollAndProcessWorkflowTaskOptions)
func WithForceNewWorkflowTask ¶
func WithForceNewWorkflowTask(o *PollAndProcessWorkflowTaskOptions)
func WithNoDumpCommands ¶
func WithNoDumpCommands(o *PollAndProcessWorkflowTaskOptions)
func WithPollSticky ¶
func WithPollSticky(o *PollAndProcessWorkflowTaskOptions)
func WithRespondSticky ¶
func WithRespondSticky(o *PollAndProcessWorkflowTaskOptions)
func WithoutRetries ¶
func WithoutRetries(o *PollAndProcessWorkflowTaskOptions)
Types ¶
type ActivityTaskHandler ¶
type AdminClient ¶
type AdminClient interface { adminservice.AdminServiceClient }
AdminClient is the interface exposed by admin service client
type ArchiverBase ¶
type ArchiverBase struct {
// contains filtered or unexported fields
}
ArchiverBase is a testcore struct for archiver provider being used in functional tests
func (*ArchiverBase) HistoryURI ¶
func (a *ArchiverBase) HistoryURI() string
func (*ArchiverBase) Metadata ¶
func (a *ArchiverBase) Metadata() archiver.ArchivalMetadata
func (*ArchiverBase) Provider ¶
func (a *ArchiverBase) Provider() provider.ArchiverProvider
func (*ArchiverBase) VisibilityURI ¶
func (a *ArchiverBase) VisibilityURI() string
type ClientFunctionalSuite ¶
type ClientFunctionalSuite struct { // override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test, // not merely log an error *require.Assertions FunctionalTestBase historyrequire.HistoryRequire // contains filtered or unexported fields }
func (*ClientFunctionalSuite) EventuallySucceeds ¶
func (s *ClientFunctionalSuite) EventuallySucceeds(ctx context.Context, operationCtx backoff.OperationCtx)
func (*ClientFunctionalSuite) HistoryContainsFailureCausedBy ¶
func (s *ClientFunctionalSuite) HistoryContainsFailureCausedBy( ctx context.Context, workflowId string, cause enumspb.WorkflowTaskFailedCause, )
func (*ClientFunctionalSuite) SdkClient ¶
func (s *ClientFunctionalSuite) SdkClient() sdkclient.Client
func (*ClientFunctionalSuite) SetupSuite ¶
func (s *ClientFunctionalSuite) SetupSuite()
func (*ClientFunctionalSuite) SetupTest ¶
func (s *ClientFunctionalSuite) SetupTest()
func (*ClientFunctionalSuite) TaskQueue ¶
func (s *ClientFunctionalSuite) TaskQueue() string
func (*ClientFunctionalSuite) TearDownSuite ¶
func (s *ClientFunctionalSuite) TearDownSuite()
func (*ClientFunctionalSuite) TearDownTest ¶
func (s *ClientFunctionalSuite) TearDownTest()
func (*ClientFunctionalSuite) Worker ¶
func (s *ClientFunctionalSuite) Worker() worker.Worker
type FrontendClient ¶
type FrontendClient interface { workflowservice.WorkflowServiceClient }
FrontendClient is the interface exposed by frontend service client
type FrontendConfig ¶
type FrontendConfig struct {
NumFrontendHosts int
}
FrontendConfig is the config for the frontend service
type FunctionalSuite ¶
type FunctionalSuite struct { // override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test, // not merely log an error *require.Assertions protorequire.ProtoAssertions historyrequire.HistoryRequire updateutils.UpdateUtils FunctionalTestBase TaskPoller *taskpoller.TaskPoller }
func (*FunctionalSuite) SendSignal ¶
func (s *FunctionalSuite) SendSignal(namespace string, execution *commonpb.WorkflowExecution, signalName string, input *commonpb.Payloads, identity string) error
func (*FunctionalSuite) SetupSuite ¶
func (s *FunctionalSuite) SetupSuite()
func (*FunctionalSuite) SetupTest ¶
func (s *FunctionalSuite) SetupTest()
func (*FunctionalSuite) TearDownSuite ¶
func (s *FunctionalSuite) TearDownSuite()
type FunctionalTestBase ¶
type FunctionalTestBase struct { suite.Suite Logger log.Logger // contains filtered or unexported fields }
FunctionalTestBase is a testcore struct for functional tests
func (*FunctionalTestBase) AdminClient ¶
func (s *FunctionalTestBase) AdminClient() AdminClient
func (*FunctionalTestBase) ArchivalNamespace ¶
func (s *FunctionalTestBase) ArchivalNamespace() string
func (*FunctionalTestBase) DecodePayloadsByteSliceInt32 ¶
func (s *FunctionalTestBase) DecodePayloadsByteSliceInt32(ps *commonpb.Payloads) (r int32)
func (*FunctionalTestBase) DecodePayloadsInt ¶
func (s *FunctionalTestBase) DecodePayloadsInt(ps *commonpb.Payloads) int
func (*FunctionalTestBase) DecodePayloadsString ¶
func (s *FunctionalTestBase) DecodePayloadsString(ps *commonpb.Payloads) string
func (*FunctionalTestBase) DurationNear ¶
func (s *FunctionalTestBase) DurationNear(value, target, tolerance time.Duration)
func (*FunctionalTestBase) ForeignNamespace ¶
func (s *FunctionalTestBase) ForeignNamespace() string
func (*FunctionalTestBase) FrontendClient ¶
func (s *FunctionalTestBase) FrontendClient() FrontendClient
func (*FunctionalTestBase) FrontendGRPCAddress ¶
func (s *FunctionalTestBase) FrontendGRPCAddress() string
func (*FunctionalTestBase) GetHistory ¶
func (s *FunctionalTestBase) GetHistory(namespace string, execution *commonpb.WorkflowExecution) []*historypb.HistoryEvent
func (*FunctionalTestBase) GetHistoryFunc ¶
func (s *FunctionalTestBase) GetHistoryFunc(namespace string, execution *commonpb.WorkflowExecution) func() []*historypb.HistoryEvent
func (*FunctionalTestBase) GetNamespaceID ¶
func (s *FunctionalTestBase) GetNamespaceID(namespace string) string
func (*FunctionalTestBase) GetTestCluster ¶
func (s *FunctionalTestBase) GetTestCluster() *TestCluster
func (*FunctionalTestBase) GetTestClusterConfig ¶
func (s *FunctionalTestBase) GetTestClusterConfig() *TestClusterConfig
func (*FunctionalTestBase) HttpAPIAddress ¶
func (s *FunctionalTestBase) HttpAPIAddress() string
func (*FunctionalTestBase) Namespace ¶
func (s *FunctionalTestBase) Namespace() string
func (*FunctionalTestBase) OperatorClient ¶
func (s *FunctionalTestBase) OperatorClient() operatorservice.OperatorServiceClient
func (*FunctionalTestBase) OverrideDynamicConfig ¶
func (s *FunctionalTestBase) OverrideDynamicConfig(setting dynamicconfig.GenericSetting, value any) (cleanup func())
Overrides one dynamic config setting for the duration of this test (or sub-test). The change will automatically be reverted at the end of the test (using t.Cleanup). The cleanup function is also returned if you want to revert the change before the end of the test.
func (*FunctionalTestBase) RunTestWithMatchingBehavior ¶
func (s *FunctionalTestBase) RunTestWithMatchingBehavior(subtest func())
func (*FunctionalTestBase) SetDynamicConfigOverrides ¶
func (s *FunctionalTestBase) SetDynamicConfigOverrides(dynamicConfig map[dynamicconfig.Key]interface{})
func (*FunctionalTestBase) SetupSuite ¶
func (s *FunctionalTestBase) SetupSuite(defaultClusterConfigFile string, options ...Option)
func (*FunctionalTestBase) SetupTest ¶
func (s *FunctionalTestBase) SetupTest()
All test suites that inherit FunctionalTestBase and overwrite SetupTest must call this testcore FunctionalTestBase.SetupTest function to distribute the tests into partitions. Otherwise, the test suite will be executed multiple times in each partition. Furthermore, all test suites in the "tests/" directory that don't inherit from FunctionalTestBase must implement SetupTest that calls checkTestShard.
func (*FunctionalTestBase) TearDownSuite ¶
func (s *FunctionalTestBase) TearDownSuite()
type FunctionalTestBaseSuite ¶
type FunctionalTestBaseSuite struct { *require.Assertions FunctionalTestBase // contains filtered or unexported fields }
func (*FunctionalTestBaseSuite) SetupSuite ¶
func (s *FunctionalTestBaseSuite) SetupSuite()
func (*FunctionalTestBaseSuite) SetupTest ¶
func (s *FunctionalTestBaseSuite) SetupTest()
func (*FunctionalTestBaseSuite) TearDownSuite ¶
func (s *FunctionalTestBaseSuite) TearDownSuite()
func (*FunctionalTestBaseSuite) TestWithFxOptionsForService ¶
func (s *FunctionalTestBaseSuite) TestWithFxOptionsForService()
type HistoryClient ¶
type HistoryClient interface { historyservice.HistoryServiceClient }
HistoryClient is the interface exposed by history service client
type HistoryConfig ¶
type HistoryConfig struct { NumHistoryShards int32 NumHistoryHosts int HistoryCountLimitError int HistoryCountLimitWarn int HistorySizeLimitError int HistorySizeLimitWarn int BlobSizeLimitError int BlobSizeLimitWarn int MutableStateSizeLimitError int MutableStateSizeLimitWarn int }
HistoryConfig contains configs for history service
type MatchingConfig ¶
type MatchingConfig struct {
NumMatchingHosts int
}
MatchingConfig is the config for the matching service
type MessageHandler ¶
type MessageHandler func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*protocolpb.Message, error)
type Option ¶
type Option func(params *TestClusterParams)
func WithFxOptionsForService ¶
func WithFxOptionsForService(serviceName primitives.ServiceName, options ...fx.Option) Option
WithFxOptionsForService returns an Option which, when passed as an argument to setupSuite, will append the given list of fx options to the end of the arguments to the fx.New call for the given service. For example, if you want to obtain the shard controller for the history service, you can do this:
var shardController shard.Controller s.setupSuite(t, tests.WithFxOptionsForService(primitives.HistoryService, fx.Populate(&shardController))) // now you can use shardController during your test
This is similar to the pattern of plumbing dependencies through the TestClusterConfig, but it's much more convenient, scalable and flexible. The reason we need to do this on a per-service basis is that there are separate fx apps for each one.
type PersistenceTestBaseFactory ¶
type PersistenceTestBaseFactory interface {
NewTestBase(options *persistencetests.TestBaseOptions) *persistencetests.TestBase
}
type PollAndProcessWorkflowTaskOptionFunc ¶
type PollAndProcessWorkflowTaskOptionFunc func(*PollAndProcessWorkflowTaskOptions)
func WithExpectedAttemptCount ¶
func WithExpectedAttemptCount(c int) PollAndProcessWorkflowTaskOptionFunc
func WithRetries ¶
func WithRetries(c int) PollAndProcessWorkflowTaskOptionFunc
type PollAndProcessWorkflowTaskResponse ¶
type PollAndProcessWorkflowTaskResponse struct { IsQueryTask bool NewTask *workflowservice.RespondWorkflowTaskCompletedResponse }
type QueryHandler ¶
type SearchAttributeTestMapper ¶
type SearchAttributeTestMapper struct{}
func NewSearchAttributeTestMapper ¶
func NewSearchAttributeTestMapper() *SearchAttributeTestMapper
func (*SearchAttributeTestMapper) GetAlias ¶
func (t *SearchAttributeTestMapper) GetAlias(fieldName string, namespace string) (string, error)
func (*SearchAttributeTestMapper) GetFieldName ¶
func (t *SearchAttributeTestMapper) GetFieldName(alias string, namespace string) (string, error)
type TaskPoller
deprecated
type TaskPoller struct { Client workflowservice.WorkflowServiceClient Namespace string TaskQueue *taskqueuepb.TaskQueue StickyTaskQueue *taskqueuepb.TaskQueue StickyScheduleToStartTimeout time.Duration Identity string WorkflowTaskHandler WorkflowTaskHandler ActivityTaskHandler ActivityTaskHandler QueryHandler QueryHandler MessageHandler MessageHandler Logger log.Logger T *testing.T }
Deprecated: TaskPoller is deprecated. Use taskpoller.TaskPoller instead. TaskPoller is used in functional tests to poll workflow or activity task queues.
func (*TaskPoller) HandlePartialWorkflowTask ¶
func (p *TaskPoller) HandlePartialWorkflowTask(response *workflowservice.PollWorkflowTaskQueueResponse, forceCreateNewWorkflowTask bool) (*workflowservice.RespondWorkflowTaskCompletedResponse, error)
HandlePartialWorkflowTask for workflow task
func (*TaskPoller) PollAndProcessActivityTask ¶
func (p *TaskPoller) PollAndProcessActivityTask(dropTask bool) error
PollAndProcessActivityTask for activity tasks
func (*TaskPoller) PollAndProcessActivityTaskWithID ¶
func (p *TaskPoller) PollAndProcessActivityTaskWithID(dropTask bool) error
PollAndProcessActivityTaskWithID is similar to PollAndProcessActivityTask but using RespondActivityTask...ByID
func (*TaskPoller) PollAndProcessWorkflowTask ¶
func (p *TaskPoller) PollAndProcessWorkflowTask(funcs ...PollAndProcessWorkflowTaskOptionFunc) (res PollAndProcessWorkflowTaskResponse, err error)
func (*TaskPoller) PollAndProcessWorkflowTaskWithOptions ¶
func (p *TaskPoller) PollAndProcessWorkflowTaskWithOptions(opts *PollAndProcessWorkflowTaskOptions) (res PollAndProcessWorkflowTaskResponse, err error)
type TemporalImpl ¶
type TemporalImpl struct {
// contains filtered or unexported fields
}
func (*TemporalImpl) AdminClient ¶
func (c *TemporalImpl) AdminClient() adminservice.AdminServiceClient
func (*TemporalImpl) Authorize ¶
func (c *TemporalImpl) Authorize( ctx context.Context, caller *authorization.Claims, target *authorization.CallTarget, ) (authorization.Result, error)
func (*TemporalImpl) CaptureMetricsHandler ¶
func (c *TemporalImpl) CaptureMetricsHandler() *metricstest.CaptureHandler
func (*TemporalImpl) DcClient ¶
func (c *TemporalImpl) DcClient() *dynamicconfig.MemoryClient
func (*TemporalImpl) FrontendClient ¶
func (c *TemporalImpl) FrontendClient() workflowservice.WorkflowServiceClient
func (*TemporalImpl) FrontendGRPCAddress ¶
func (c *TemporalImpl) FrontendGRPCAddress() string
func (*TemporalImpl) FrontendHTTPAddress ¶
func (c *TemporalImpl) FrontendHTTPAddress() string
func (*TemporalImpl) FrontendNamespaceRegistries ¶
func (c *TemporalImpl) FrontendNamespaceRegistries() []namespace.Registry
func (*TemporalImpl) GetClaims ¶
func (c *TemporalImpl) GetClaims(authInfo *authorization.AuthInfo) (*authorization.Claims, error)
func (*TemporalImpl) GetExecutionManager ¶
func (c *TemporalImpl) GetExecutionManager() persistence.ExecutionManager
func (*TemporalImpl) GetMetricsHandler ¶
func (c *TemporalImpl) GetMetricsHandler() metrics.Handler
func (*TemporalImpl) GetTLSConfigProvider ¶
func (c *TemporalImpl) GetTLSConfigProvider() encryption.TLSConfigProvider
func (*TemporalImpl) GetTaskCategoryRegistry ¶
func (c *TemporalImpl) GetTaskCategoryRegistry() tasks.TaskCategoryRegistry
func (*TemporalImpl) HistoryClient ¶
func (c *TemporalImpl) HistoryClient() historyservice.HistoryServiceClient
func (*TemporalImpl) MatchingClient ¶
func (c *TemporalImpl) MatchingClient() matchingservice.MatchingServiceClient
func (*TemporalImpl) OperatorClient ¶
func (c *TemporalImpl) OperatorClient() operatorservice.OperatorServiceClient
func (*TemporalImpl) RemoteFrontendGRPCAddress ¶
func (c *TemporalImpl) RemoteFrontendGRPCAddress() string
Use this to get an address for a remote cluster to connect to.
func (*TemporalImpl) SetOnAuthorize ¶
func (c *TemporalImpl) SetOnAuthorize( fn func(context.Context, *authorization.Claims, *authorization.CallTarget) (authorization.Result, error), )
func (*TemporalImpl) SetOnGetClaims ¶
func (c *TemporalImpl) SetOnGetClaims(fn func(*authorization.AuthInfo) (*authorization.Claims, error))
func (*TemporalImpl) Start ¶
func (c *TemporalImpl) Start() error
func (*TemporalImpl) Stop ¶
func (c *TemporalImpl) Stop() error
func (*TemporalImpl) TlsConfigProvider ¶
func (c *TemporalImpl) TlsConfigProvider() *encryption.FixedTLSConfigProvider
type TemporalParams ¶
type TemporalParams struct { ClusterMetadataConfig *cluster.Config PersistenceConfig config.Persistence MetadataMgr persistence.MetadataManager ClusterMetadataManager persistence.ClusterMetadataManager ShardMgr persistence.ShardManager ExecutionManager persistence.ExecutionManager TaskMgr persistence.TaskManager NamespaceReplicationQueue persistence.NamespaceReplicationQueue AbstractDataStoreFactory persistenceClient.AbstractDataStoreFactory VisibilityStoreFactory visibility.VisibilityStoreFactory Logger log.Logger ArchiverMetadata carchiver.ArchivalMetadata ArchiverProvider provider.ArchiverProvider EnableReadHistoryFromArchival bool FrontendConfig FrontendConfig HistoryConfig HistoryConfig MatchingConfig MatchingConfig WorkerConfig WorkerConfig ESConfig *esclient.Config ESClient esclient.Client MockAdminClient map[string]adminservice.AdminServiceClient NamespaceReplicationTaskExecutor namespace.ReplicationTaskExecutor SpanExporters []otelsdktrace.SpanExporter DynamicConfigOverrides map[dynamicconfig.Key]interface{} TLSConfigProvider *encryption.FixedTLSConfigProvider CaptureMetricsHandler *metricstest.CaptureHandler // ServiceFxOptions is populated by WithFxOptionsForService. ServiceFxOptions map[primitives.ServiceName][]fx.Option TaskCategoryRegistry tasks.TaskCategoryRegistry HostsByProtocolByService map[transferProtocol]map[primitives.ServiceName]static.Hosts }
TemporalParams contains everything needed to bootstrap Temporal
type TestCluster ¶
type TestCluster struct {
// contains filtered or unexported fields
}
TestCluster is a testcore struct for functional tests
func NewClusterWithPersistenceTestBaseFactory ¶
func NewClusterWithPersistenceTestBaseFactory(t *testing.T, options *TestClusterConfig, logger log.Logger, tbFactory PersistenceTestBaseFactory) (*TestCluster, error)
func (*TestCluster) AdminClient ¶
func (tc *TestCluster) AdminClient() AdminClient
AdminClient returns an admin client from the test cluster
func (*TestCluster) ArchivalBase ¶
func (tc *TestCluster) ArchivalBase() *ArchiverBase
func (*TestCluster) ExecutionManager ¶
func (tc *TestCluster) ExecutionManager() persistence.ExecutionManager
ExecutionManager returns an execution manager factory from the test cluster
func (*TestCluster) FrontendClient ¶
func (tc *TestCluster) FrontendClient() FrontendClient
FrontendClient returns a frontend client from the test cluster
func (*TestCluster) HistoryClient ¶
func (tc *TestCluster) HistoryClient() historyservice.HistoryServiceClient
HistoryClient returns a history client from the test cluster
func (*TestCluster) Host ¶
func (tc *TestCluster) Host() *TemporalImpl
func (*TestCluster) MatchingClient ¶
func (tc *TestCluster) MatchingClient() matchingservice.MatchingServiceClient
MatchingClient returns a matching client from the test cluster
func (*TestCluster) OperatorClient ¶
func (tc *TestCluster) OperatorClient() operatorservice.OperatorServiceClient
func (*TestCluster) OverrideDynamicConfig ¶
func (tc *TestCluster) OverrideDynamicConfig(t *testing.T, key dynamicconfig.GenericSetting, value any) (cleanup func())
func (*TestCluster) TearDownCluster ¶
func (tc *TestCluster) TearDownCluster() error
TearDownCluster tears down the test cluster
func (*TestCluster) TestBase ¶
func (tc *TestCluster) TestBase() *persistencetests.TestBase
type TestClusterConfig ¶
type TestClusterConfig struct { EnableArchival bool IsMasterCluster bool ClusterMetadata cluster.Config Persistence persistencetests.TestBaseOptions FrontendConfig FrontendConfig HistoryConfig HistoryConfig MatchingConfig MatchingConfig WorkerConfig WorkerConfig ESConfig *esclient.Config MockAdminClient map[string]adminservice.AdminServiceClient FaultInjection config.FaultInjection `yaml:"faultInjection"` DynamicConfigOverrides map[dynamicconfig.Key]interface{} GenerateMTLS bool EnableMetricsCapture bool // ServiceFxOptions can be populated using WithFxOptionsForService. ServiceFxOptions map[primitives.ServiceName][]fx.Option DeprecatedFrontendAddress string `yaml:"frontendAddress"` DeprecatedClusterNo int `yaml:"clusterno"` }
TestClusterConfig are config for a test cluster
func GetTestClusterConfig ¶
func GetTestClusterConfig(configFile string) (*TestClusterConfig, error)
GetTestClusterConfig return test cluster config
type TestClusterFactory ¶
type TestClusterFactory interface {
NewCluster(t *testing.T, options *TestClusterConfig, logger log.Logger) (*TestCluster, error)
}
func NewTestClusterFactory ¶
func NewTestClusterFactory() TestClusterFactory
func NewTestClusterFactoryWithCustomTestBaseFactory ¶
func NewTestClusterFactoryWithCustomTestBaseFactory(tbFactory PersistenceTestBaseFactory) TestClusterFactory
type TestClusterParams ¶
type TestClusterParams struct {
ServiceOptions map[primitives.ServiceName][]fx.Option
}
TestClusterParams contains the variables which are used to configure test suites via the Option type.
func ApplyTestClusterParams ¶
func ApplyTestClusterParams(options []Option) TestClusterParams
type TestDataConverter ¶
type TestDataConverter struct { NumOfCallToPayloads int // for testing to know testDataConverter is called as expected NumOfCallFromPayloads int }
TestDataConverter implements encoded.DataConverter using gob
func (*TestDataConverter) FromPayload ¶
func (tdc *TestDataConverter) FromPayload(payload *commonpb.Payload, valuePtr interface{}) error
func (*TestDataConverter) FromPayloads ¶
func (tdc *TestDataConverter) FromPayloads(payloads *commonpb.Payloads, valuePtrs ...interface{}) error
func (*TestDataConverter) ToPayload ¶
func (tdc *TestDataConverter) ToPayload(value interface{}) (*commonpb.Payload, error)
func (*TestDataConverter) ToPayloads ¶
func (tdc *TestDataConverter) ToPayloads(values ...interface{}) (*commonpb.Payloads, error)
type WorkerConfig ¶
type WorkerConfig struct { EnableArchiver bool EnableReplicator bool NumWorkers int DisableWorker bool // overrides NumWorkers }
WorkerConfig is the config for the worker service