Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cassandra test setup to use input port #552

Merged
merged 4 commits into from
Feb 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions common/persistence/persistenceTestBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (s *TestBase) SetupWorkflowStoreWithOptions(options TestBaseOptions) {
testAllClusterNames,
)
// Setup Workflow keyspace and deploy schema for tests
s.CassandraTestCluster.setupTestCluster(options.KeySpace, options.DropKeySpace, options.SchemaDir)
s.CassandraTestCluster.setupTestCluster(options)
shardID := 0
var err error
s.ShardMgr, err = NewCassandraShardPersistence(options.ClusterHost, options.ClusterPort, options.ClusterUser,
Expand Down Expand Up @@ -843,15 +843,18 @@ func (s *TestBase) ClearTransferQueue() {
atomic.StoreInt64(&s.readLevel, 0)
}

func (s *CassandraTestCluster) setupTestCluster(keySpace string, dropKeySpace bool, schemaDir string) {
func (s *CassandraTestCluster) setupTestCluster(options TestBaseOptions) {
keySpace := options.KeySpace
if keySpace == "" {
keySpace = generateRandomKeyspace(10)
}
s.createCluster(testWorkflowClusterHosts, testPort, testUser, testPassword, testDatacenter, gocql.Consistency(1),
keySpace)
s.createKeyspace(1, dropKeySpace)
s.loadSchema([]string{"schema.cql"}, schemaDir)
s.loadVisibilitySchema([]string{"schema.cql"}, schemaDir)
s.createCluster(
testWorkflowClusterHosts, options.ClusterPort, testUser, testPassword, testDatacenter,
gocql.Consistency(1), keySpace,
)
s.createKeyspace(1, options.DropKeySpace)
s.loadSchema([]string{"schema.cql"}, options.SchemaDir)
s.loadVisibilitySchema([]string{"schema.cql"}, options.SchemaDir)
}

func (s *CassandraTestCluster) tearDownTestCluster() {
Expand Down