Files
tasks/tools/cassandra/setup_task_tests.go
Alex ShtinandGitHub a541b57ac8 Cleanup environment variables helpers (#7842)
## 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)
2025-06-02 12:30:07 -07:00

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"})
}