TestsDisableGSI returns true if tests should be forced to avoid any GSI-specific code.
()
| 270 | |
| 271 | // TestsDisableGSI returns true if tests should be forced to avoid any GSI-specific code. |
| 272 | func 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 |
| 288 | func TestUseCouchbaseServer() bool { |
no test coverage detected