Skip to content

Commit

Permalink
Remove database check for config store tests (uber#5401)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll authored Sep 18, 2023
1 parent 4a16136 commit 842de10
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions common/persistence/persistence-tests/configStorePersistenceTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,10 @@ import (
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

"github.com/uber/cadence/common/config"
p "github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/persistence/nosql/nosqlplugin/cassandra"
"github.com/uber/cadence/common/persistence/nosql/nosqlplugin/mongodb"
"github.com/uber/cadence/common/types"
)

var supportedPlugins = map[string]bool{
cassandra.PluginName: true,
mongodb.PluginName: true,
}

// Currently you cannot clear or remove any entries in cluster_config table
// Therefore, Teardown and Setup of Test DB is required before every test.

Expand Down Expand Up @@ -75,10 +67,6 @@ func (s *ConfigStorePersistenceSuite) TearDownSuite() {

// Tests if error is returned when trying to fetch dc values from empty table
func (s *ConfigStorePersistenceSuite) TestFetchFromEmptyTable() {
if !validDatabaseCheck(s.Config()) {
s.T().Skip()
}

ctx, cancel := context.WithTimeout(context.Background(), testContextTimeout)
defer cancel()

Expand All @@ -91,10 +79,6 @@ func (s *ConfigStorePersistenceSuite) TestFetchFromEmptyTable() {
}

func (s *ConfigStorePersistenceSuite) TestUpdateSimpleSuccess() {
if !validDatabaseCheck(s.Config()) {
s.T().Skip()
}

ctx, cancel := context.WithTimeout(context.Background(), testContextTimeout)
defer cancel()

Expand All @@ -113,10 +97,6 @@ func (s *ConfigStorePersistenceSuite) TestUpdateSimpleSuccess() {
}

func (s *ConfigStorePersistenceSuite) TestUpdateVersionCollisionFailure() {
if !validDatabaseCheck(s.Config()) {
s.T().Skip()
}

ctx, cancel := context.WithTimeout(context.Background(), testContextTimeout)
defer cancel()

Expand All @@ -133,10 +113,6 @@ func (s *ConfigStorePersistenceSuite) TestUpdateVersionCollisionFailure() {
}

func (s *ConfigStorePersistenceSuite) TestUpdateIncrementalVersionSuccess() {
if !validDatabaseCheck(s.Config()) {
s.T().Skip()
}

ctx, cancel := context.WithTimeout(context.Background(), testContextTimeout)
defer cancel()

Expand All @@ -152,10 +128,6 @@ func (s *ConfigStorePersistenceSuite) TestUpdateIncrementalVersionSuccess() {
}

func (s *ConfigStorePersistenceSuite) TestFetchLatestVersionSuccess() {
if !validDatabaseCheck(s.Config()) {
s.T().Skip()
}

ctx, cancel := context.WithTimeout(context.Background(), testContextTimeout)
defer cancel()

Expand Down Expand Up @@ -202,15 +174,6 @@ func generateRandomSnapshot(version int64) *p.DynamicConfigSnapshot {
}
}

func validDatabaseCheck(cfg config.Persistence) bool {
if datastore, ok := cfg.DataStores[cfg.DefaultStore]; ok {
if datastore.NoSQL != nil {
return supportedPlugins[datastore.NoSQL.PluginName]
}
}
return false
}

func (s *ConfigStorePersistenceSuite) FetchDynamicConfig(ctx context.Context) (*p.DynamicConfigSnapshot, error) {
response, err := s.ConfigStoreManager.FetchDynamicConfig(ctx, p.DynamicConfig)
if err != nil {
Expand Down

0 comments on commit 842de10

Please sign in to comment.