mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
Full module path rebrand from Temporal to Hanzo Tasks: - go.mod module: github.com/hanzoai/tasks - All internal Go imports updated (1906 files) - cmd/server renamed to cmd/tasksd - Binary name: tasksd (was temporal-server) - Docker images: hanzoai/tasks (was temporalio/server) - README rewritten with Hanzo Tasks branding - LLM.md created with integration notes - Makefile, goreleaser, CI workflows updated - go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos) Fork of Temporal.io (MIT license).
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package ndc
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/hanzoai/tasks/common/cluster"
|
|
"github.com/hanzoai/tasks/tests/testcore"
|
|
)
|
|
|
|
func clustersConfig(clusterNames ...string) []*testcore.TestClusterConfig {
|
|
// TODO (alex): I don't know how many of these settings are really needed.
|
|
|
|
if len(clusterNames) < 2 {
|
|
//nolint:forbidigo // test code
|
|
panic("at least 2 clusters are needed for ndc tests")
|
|
}
|
|
|
|
clusterInformation := make(map[string]cluster.ClusterInformation, len(clusterNames))
|
|
for i, cn := range clusterNames {
|
|
clusterInformation[cn] = cluster.ClusterInformation{
|
|
Enabled: true,
|
|
InitialFailoverVersion: int64(i + 1),
|
|
RPCAddress: fmt.Sprintf("nowhere%d:7134", i+1),
|
|
}
|
|
}
|
|
|
|
var clusterConfigs []*testcore.TestClusterConfig
|
|
|
|
for _, cn := range clusterNames {
|
|
clusterConfig := &testcore.TestClusterConfig{
|
|
ClusterMetadata: cluster.Config{
|
|
EnableGlobalNamespace: true,
|
|
FailoverVersionIncrement: 10,
|
|
MasterClusterName: clusterNames[0], // the first one is always master.
|
|
CurrentClusterName: cn,
|
|
ClusterInformation: clusterInformation,
|
|
},
|
|
HistoryConfig: testcore.HistoryConfig{
|
|
NumHistoryShards: 1,
|
|
},
|
|
}
|
|
clusterConfigs = append(clusterConfigs, clusterConfig)
|
|
}
|
|
|
|
return clusterConfigs
|
|
}
|