mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? - improve comments - removed useless comments - unexport constants ## Why? Long awaited refactoring. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
39 lines
919 B
Go
39 lines
919 B
Go
package cassandra
|
|
|
|
import (
|
|
"go.temporal.io/server/common/log/tag"
|
|
"go.temporal.io/server/tools/common/schema/test"
|
|
)
|
|
|
|
type (
|
|
SetupSchemaTestSuite struct {
|
|
test.SetupSchemaTestBase
|
|
client *cqlClient
|
|
}
|
|
)
|
|
|
|
func (s *SetupSchemaTestSuite) SetupSuite() {
|
|
client, err := newTestCQLClient(systemKeyspace)
|
|
if err != nil {
|
|
s.Logger.Fatal("Error creating CQLClient", tag.Error(err))
|
|
}
|
|
s.client = client
|
|
s.SetupSuiteBase(client, "")
|
|
}
|
|
|
|
func (s *SetupSchemaTestSuite) TearDownSuite() {
|
|
s.TearDownSuiteBase()
|
|
}
|
|
|
|
func (s *SetupSchemaTestSuite) TestCreateKeyspace() {
|
|
s.Nil(RunTool([]string{"./tool", "create", "-k", "foobar123", "--rf", "1"}))
|
|
err := s.client.dropKeyspace("foobar123")
|
|
s.Nil(err)
|
|
}
|
|
|
|
func (s *SetupSchemaTestSuite) TestSetupSchema() {
|
|
client, err := newTestCQLClient(s.DBName)
|
|
s.Nil(err)
|
|
s.RunSetupTest(buildCLIOptions(), client, "-k", createTestCQLFileContent(), []string{"tasks", "events"})
|
|
}
|