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

Function TestLoadServerConfigExamples

rest/config_test.go:440–467  ·  view source on GitHub ↗

TestLoadServerConfigExamples will run LoadLegacyServerConfig for configs found under the legacy examples directory.

(t *testing.T)

Source from the content-addressed store, hash-verified

438
439// TestLoadServerConfigExamples will run LoadLegacyServerConfig for configs found under the legacy examples directory.
440func TestLoadServerConfigExamples(t *testing.T) {
441 const exampleLogDirectory = "../examples/legacy_config"
442 const configSuffix = ".json"
443
444 const enterpriseConfigPrefix = "ee_"
445
446 err := filepath.Walk(exampleLogDirectory, func(configPath string, file os.FileInfo, err error) error {
447 assert.NoError(t, err)
448
449 // Skip directories or files that aren't configs
450 if file.IsDir() || !strings.HasSuffix(file.Name(), configSuffix) {
451 return nil
452 }
453
454 // Skip EE configs in CE
455 if !base.IsEnterpriseEdition() && strings.HasPrefix(file.Name(), enterpriseConfigPrefix) {
456 return nil
457 }
458
459 t.Run(configPath, func(tt *testing.T) {
460 _, err := LoadLegacyServerConfig(base.TestCtx(t), configPath)
461 assert.NoError(tt, err, "unexpected error validating example config")
462 })
463
464 return nil
465 })
466 assert.NoError(t, err)
467}
468
469func TestDeprecatedCacheConfig(t *testing.T) {
470 // Create new DbConfig

Callers

nothing calls this directly

Calls 5

IsEnterpriseEditionFunction · 0.92
TestCtxFunction · 0.92
LoadLegacyServerConfigFunction · 0.85
NameMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected