Skip to content

Commit

Permalink
Enable extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin committed Nov 28, 2023
1 parent 632c63e commit 8f0c09b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 55 deletions.
8 changes: 1 addition & 7 deletions rest/adminapitest/admin_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3309,9 +3309,6 @@ func TestSwitchDbConfigCollectionName(t *testing.T) {
}

func TestPutDBConfigOIDC(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP)

Expand Down Expand Up @@ -3642,9 +3639,6 @@ func TestDbOfflineConfigPersistent(t *testing.T) {

// TestDbConfigPersistentSGVersions ensures that cluster-wide config updates are not applied to older nodes to avoid pushing invalid configuration.
func TestDbConfigPersistentSGVersions(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.SetUpTestLogging(t, base.LevelDebug, base.KeyConfig)

Expand Down Expand Up @@ -3944,7 +3938,7 @@ func TestDisablePasswordAuthThroughAdminAPI(t *testing.T) {

// CBG-1790: Deleting a database that targets the same bucket as another causes a panic in legacy
func TestDeleteDatabasePointingAtSameBucket(t *testing.T) {
if base.UnitTestUrlIsWalrus() || !base.TestUseXattrs() {
if !base.TestUseXattrs() {
t.Skip("This test only works against Couchbase Server with xattrs")
}
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP)
Expand Down
8 changes: 3 additions & 5 deletions rest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1356,11 +1356,9 @@ func SetupServerContext(ctx context.Context, config *StartupConfig, persistentCo
}

sc := NewServerContext(ctx, config, persistentConfig)
if !base.ServerIsWalrus(config.Bootstrap.Server) {
failFast := false
if err := sc.initializeCouchbaseServerConnections(ctx, failFast); err != nil {
return nil, err
}
failFast := false
if err := sc.initializeCouchbaseServerConnections(ctx, failFast); err != nil {
return nil, err
}
return sc, nil
}
Expand Down
8 changes: 0 additions & 8 deletions rest/config_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import (
)

func TestBootstrapConfig(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)

base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyDCP)
Expand Down Expand Up @@ -176,10 +172,6 @@ func TestLongMetadataID(t *testing.T) {
}

func TestVersionDowngrade(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

// rely on AtLeastMinorDowngrade unit test to cover all cases, starting up a db is slow
testCases := []struct {
syncGatewayVersion string
Expand Down
26 changes: 1 addition & 25 deletions rest/persistent_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,6 @@ func TestPersistentConfigWithCollectionConflicts(t *testing.T) {
// 5. UpdateConfig to a different db, with collection conflict with the failed create (should fail with conflict, but succeed after GetDatabaseConfigs runs)
// 6. DeleteConfig for the same db name (triggers rollback, then returns ErrNotFound for the delete operation)
func TestPersistentConfigRegistryRollbackAfterCreateFailure(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down Expand Up @@ -617,10 +613,6 @@ func TestPersistentConfigRegistryRollbackAfterCreateFailure(t *testing.T) {
// 5. DeleteConfig for the same db name (triggers rollback, then successfully deletes)

func TestPersistentConfigRegistryRollbackAfterUpdateFailure(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down Expand Up @@ -771,10 +763,6 @@ func TestPersistentConfigRegistryRollbackAfterUpdateFailure(t *testing.T) {
// 4. Attempt recreation of database with earlier version generation, after delete fails. Should resolve delete and succeed
// 5. Attempt update of database after delete fails. Should return "database does not exist" error
func TestPersistentConfigRegistryRollbackAfterDeleteFailure(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down Expand Up @@ -888,10 +876,6 @@ func TestPersistentConfigRegistryRollbackAfterDeleteFailure(t *testing.T) {
// triggers rollback before the config document is updated. Verifies that the original create operation
// fails and returns an appropriate error
func TestPersistentConfigSlowCreateFailure(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down Expand Up @@ -1051,7 +1035,7 @@ func TestMigratev30PersistentConfig(t *testing.T) {

func TestMigratev30PersistentConfigUseXattrStore(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
t.Skip("xattr storage is only enabled with CBS and not RosmarCluster")
}

base.TestRequiresCollections(t)
Expand Down Expand Up @@ -1137,10 +1121,6 @@ func TestMigratev30PersistentConfigUseXattrStore(t *testing.T) {
// TestMigratev30PersistentConfigCollision sets up a 3.1 database targeting the default collection, then attempts
// migration of another database in the 3.0 format (which also targets the default collection)
func TestMigratev30PersistentConfigCollision(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down Expand Up @@ -1209,10 +1189,6 @@ func TestMigratev30PersistentConfigCollision(t *testing.T) {

// TestLegacyDuplicate tests the behaviour of GetDatabaseConfigs when the same database exists in legacy and non-legacy format
func TestLegacyDuplicate(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.TestRequiresCollections(t)
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeyConfig)

Expand Down
16 changes: 6 additions & 10 deletions rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1839,9 +1839,6 @@ func TestReplicationHeartbeatRemoval(t *testing.T) {

// Repros CBG-2416
func TestDBReplicationStatsTeardown(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("This test only works against Couchbase Server")
}

base.RequireNumTestBuckets(t, 2)
// Test tests Prometheus stat registration
Expand Down Expand Up @@ -1947,10 +1944,6 @@ func TestPushReplicationAPIUpdateDatabase(t *testing.T) {

t.Skip("Skipping test - revisit in CBG-1908")

if base.UnitTestUrlIsWalrus() {
t.Skip("Test does not support Walrus - depends on closing and re-opening persistent bucket")
}

base.RequireNumTestBuckets(t, 2)
base.SetUpTestLogging(t, base.LevelDebug, base.KeyReplicate, base.KeyHTTP, base.KeyHTTPResp, base.KeySync, base.KeySyncMsg)

Expand Down Expand Up @@ -7844,8 +7837,8 @@ func TestReplicatorCheckpointOnStop(t *testing.T) {

// Tests replications to make sure they are namespaced by group ID
func TestGroupIDReplications(t *testing.T) {
if base.UnitTestUrlIsWalrus() || !base.TestUseXattrs() {
t.Skip("This test requires xattrs and persistent config")
if !base.TestUseXattrs() {
t.Skip("This test requires xattrs")
}
base.RequireNumTestBuckets(t, 2)

Expand Down Expand Up @@ -7903,8 +7896,11 @@ func TestGroupIDReplications(t *testing.T) {
Bucket: base.StringPtr(activeBucket.GetName()),
},
EnableXattrs: base.BoolPtr(base.TestUseXattrs()),
UseViews: base.BoolPtr(base.TestsDisableGSI()),
}
if !base.UnitTestUrlIsWalrus() {
dbConfig.UseViews = base.BoolPtr(base.TestsDisableGSI())
}

if rt.GetDatabase().OnlyDefaultCollection() {
dbConfig.Sync = base.StringPtr(channels.DocChannelsSyncFunction)
} else {
Expand Down

0 comments on commit 8f0c09b

Please sign in to comment.