Skip to content

Commit

Permalink
CBG-4408 disable CBS topologytests by default (#7240)
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin authored Dec 12, 2024
1 parent ac11957 commit 407a5e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/main_test_bucket_pool_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const (

// Creates buckets with a specific number of number of replicas
tbpEnvBucketNumReplicas = "SG_TEST_BUCKET_NUM_REPLICAS"

// Environment variable to specify the topology tests to run
TbpEnvTopologyTests = "SG_TEST_TOPOLOGY_TESTS"
)

// TestsUseNamedCollections returns true if the tests use named collections.
Expand Down
7 changes: 7 additions & 0 deletions topologytest/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ package topologytest

import (
"context"
"os"
"strconv"
"testing"

"github.com/couchbase/sync_gateway/base"
Expand All @@ -20,6 +22,11 @@ import (

func TestMain(m *testing.M) {
ctx := context.Background() // start of test process
runTests, _ := strconv.ParseBool(os.Getenv(base.TbpEnvTopologyTests))
if !base.UnitTestUrlIsWalrus() && !runTests {
base.SkipTestMain(m, "Tests are disabled for Couchbase Server by default, to enable set %s=true environment variable", base.TbpEnvTopologyTests)
return
}
tbpOptions := base.TestBucketPoolOptions{MemWatermarkThresholdMB: 2048}
// Do not create indexes for this test, so they are built by server_context.go
db.TestBucketPoolWithIndexes(ctx, m, tbpOptions)
Expand Down

0 comments on commit 407a5e0

Please sign in to comment.