Documentation
¶
Index ¶
- Constants
- func Logf(t *testing.T, msg string, args ...interface{})
- func WorkerIdentityFor(clusterName string, domainName string) string
- type Cluster
- type ClusterAttributesMap
- type Operation
- type OperationFunction
- type ReplicationDomainConfig
- type ReplicationSimulation
- type ReplicationSimulationConfig
- func (s *ReplicationSimulationConfig) IsActiveActiveDomain(domainName string) bool
- func (s *ReplicationSimulationConfig) MustGetFrontendClient(t *testing.T, clusterName string) frontend.Client
- func (s *ReplicationSimulationConfig) MustInitClientsFor(t *testing.T, clusterName string)
- func (s *ReplicationSimulationConfig) MustRegisterDomain(t *testing.T, domainName string, domainCfg ReplicationDomainConfig)
- type ReplicationSimulationOperation
- type Validation
- type WorkflowInput
- type WorkflowOutput
Constants ¶
View Source
const ( DefaultTestCase = "testdata/replication_simulation_default.yaml" TasklistName = "test-tasklist" TimerInterval = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func WorkerIdentityFor ¶
Types ¶
type ClusterAttributesMap ¶
type ClusterAttributesMap struct {
// contains filtered or unexported fields
}
ClusterAttributesMap is a custom type for YAML unmarshalling of cluster attributes.
func (*ClusterAttributesMap) IsEmpty ¶
func (c *ClusterAttributesMap) IsEmpty() bool
func (*ClusterAttributesMap) ToAttributeScopes ¶
func (c *ClusterAttributesMap) ToAttributeScopes() map[string]types.ClusterAttributeScope
ToAttributeScopes is a convenience method to return the parsed AttributeScopes map.
func (*ClusterAttributesMap) UnmarshalYAML ¶
func (c *ClusterAttributesMap) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements custom YAML unmarshalling for ClusterAttributesMap.
type Operation ¶
type Operation struct {
Type ReplicationSimulationOperation `yaml:"op"`
At time.Duration `yaml:"at"`
Cluster string `yaml:"cluster"`
SourceCluster string `yaml:"sourceCluster"`
TargetCluster string `yaml:"targetCluster"`
WorkflowType string `yaml:"workflowType"`
WorkflowID string `yaml:"workflowID"`
WorkflowExecutionStartToCloseTimeout time.Duration `yaml:"workflowExecutionStartToCloseTimeout"`
WorkflowDuration time.Duration `yaml:"workflowDuration"`
ChildWorkflowID string `yaml:"childWorkflowID"`
ChildWorkflowTimeout time.Duration `yaml:"childWorkflowTimeout"`
ActivityCount int `yaml:"activityCount"`
DelayStartSeconds int32 `yaml:"delayStartSeconds"`
CronSchedule string `yaml:"cronSchedule"`
ActiveClusterSelectionPolicy *types.ActiveClusterSelectionPolicy `yaml:"activeClusterSelectionPolicy"`
WorkflowIDReusePolicy *types.WorkflowIDReusePolicy `yaml:"workflowIDReusePolicy"`
Query string `yaml:"query"`
ConsistencyLevel string `yaml:"consistencyLevel"`
SignalName string `yaml:"signalName"`
SignalInput any `yaml:"signalInput"`
EventID int64 `yaml:"eventID"`
Domain string `yaml:"domain"`
NewActiveCluster string `yaml:"newActiveCluster"`
// NewClusterAttributes specifies the AttributeScopes to change for the domain
// This can be a sub-set of the total AttributeScopes for the domain
NewClusterAttributes ClusterAttributesMap `yaml:"newClusterAttributes"`
FailoverTimeout *int32 `yaml:"failoverTimeoutSec"`
// RunIDKey specifies a key to store/retrieve RunID for this operation
RunIDKey string `yaml:"runIDKey"`
Want Validation `yaml:"want"`
}
type OperationFunction ¶ added in v1.3.6
type OperationFunction func(t *testing.T, op *Operation, simCfg *ReplicationSimulationConfig) error
type ReplicationDomainConfig ¶ added in v1.3.0
type ReplicationDomainConfig struct {
ActiveClusterName string `yaml:"activeClusterName"`
// ClusterAttributes specifies the Attributes for a domain and is passed to ActiveClusters in the RegisterDomainRequest
// It is a simplified expression for the AttributeScopes type
// The format should be expressed as follows:
// clusterAttributes: // This will be mapped to AttributeScopes
// region: // This is the key for a ClusterAttributeScope. All children are mapped to ClusterAttributes
// us-west1: cluster0 // us-west1 is the key within a ClusterAttributeScope
// us-east1: cluster1 // cluster1 is the ActiveClusterName for the corresponding ActiveClusterInfo
// cityID:
// ...
ClusterAttributes ClusterAttributesMap `yaml:"clusterAttributes"`
}
type ReplicationSimulation ¶ added in v1.3.6
func NewReplicationSimulation ¶ added in v1.3.6
func NewReplicationSimulation() *ReplicationSimulation
func (*ReplicationSimulation) GetRunID ¶ added in v1.3.6
func (s *ReplicationSimulation) GetRunID(key string) (string, error)
func (*ReplicationSimulation) StoreRunID ¶ added in v1.3.6
func (s *ReplicationSimulation) StoreRunID(key, runID string) error
type ReplicationSimulationConfig ¶
type ReplicationSimulationConfig struct {
// Clusters is the map of all clusters
Clusters map[string]*Cluster `yaml:"clusters"`
// PrimaryCluster is used for domain registration
PrimaryCluster string `yaml:"primaryCluster"`
Domains map[string]ReplicationDomainConfig `yaml:"domains"`
Operations []*Operation `yaml:"operations"`
}
func LoadConfig ¶
func LoadConfig() (*ReplicationSimulationConfig, error)
func (*ReplicationSimulationConfig) IsActiveActiveDomain ¶ added in v1.3.0
func (s *ReplicationSimulationConfig) IsActiveActiveDomain(domainName string) bool
func (*ReplicationSimulationConfig) MustGetFrontendClient ¶
func (*ReplicationSimulationConfig) MustInitClientsFor ¶
func (s *ReplicationSimulationConfig) MustInitClientsFor(t *testing.T, clusterName string)
func (*ReplicationSimulationConfig) MustRegisterDomain ¶
func (s *ReplicationSimulationConfig) MustRegisterDomain( t *testing.T, domainName string, domainCfg ReplicationDomainConfig, )
type ReplicationSimulationOperation ¶
type ReplicationSimulationOperation string
const ( ReplicationSimulationOperationStartWorkflow ReplicationSimulationOperation = "start_workflow" ReplicationSimulationOperationResetWorkflow ReplicationSimulationOperation = "reset_workflow" ReplicationSimulationOperationChangeActiveClusters ReplicationSimulationOperation = "change_active_clusters" ReplicationSimulationOperationValidate ReplicationSimulationOperation = "validate" ReplicationSimulationOperationQueryWorkflow ReplicationSimulationOperation = "query_workflow" ReplicationSimulationOperationSignalWithStartWorkflow ReplicationSimulationOperation = "signal_with_start_workflow" ReplicationSimulationOperationValidateWorkflowReplication ReplicationSimulationOperation = "validate_workflow_replication" )
type Validation ¶
type WorkflowInput ¶
type WorkflowOutput ¶
type WorkflowOutput struct {
Count int
}
Click to show internal directories.
Click to hide internal directories.