MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestsDisableGSI

Function TestsDisableGSI

base/util_testing.go:272–285  ·  view source on GitHub ↗

TestsDisableGSI returns true if tests should be forced to avoid any GSI-specific code.

()

Source from the content-addressed store, hash-verified

270
271// TestsDisableGSI returns true if tests should be forced to avoid any GSI-specific code.
272func TestsDisableGSI() bool {
273 // Disable GSI when running with Walrus
274 if !TestUseCouchbaseServer() && UnitTestUrlIsWalrus() {
275 return true
276 }
277
278 // Default to disabling GSI, but allow with SG_TEST_USE_GSI=true
279 useGSI := false
280 if envUseGSI := os.Getenv(TestEnvSyncGatewayDisableGSI); envUseGSI != "" {
281 useGSI, _ = strconv.ParseBool(envUseGSI)
282 }
283
284 return !useGSI
285}
286
287// Check the whether tests are being run with SG_TEST_BACKING_STORE=Couchbase
288func TestUseCouchbaseServer() bool {

Calls 2

TestUseCouchbaseServerFunction · 0.85
UnitTestUrlIsWalrusFunction · 0.85

Tested by

no test coverage detected