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

Function TestConfigValidationDeltaSync

rest/config_test.go:158–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func TestConfigValidationDeltaSync(t *testing.T) {
159 jsonConfig := `{"databases": {"db": {"delta_sync": {"enabled": true}}}}`
160 ctx := base.TestCtx(t)
161 buf := bytes.NewBufferString(jsonConfig)
162 config, err := readLegacyServerConfig(ctx, buf)
163 assert.NoError(t, err)
164
165 errorMessages := config.setupAndValidateDatabases(ctx)
166 require.NoError(t, errorMessages)
167
168 require.NotNil(t, config.Databases["db"])
169 require.NotNil(t, config.Databases["db"].DeltaSync)
170 if base.IsEnterpriseEdition() {
171 require.NotNil(t, config.Databases["db"].DeltaSync.Enabled)
172 assert.True(t, *config.Databases["db"].DeltaSync.Enabled)
173 } else {
174 // CE disallowed - should be nil
175 assert.Nil(t, config.Databases["db"].DeltaSync.Enabled)
176 }
177}
178
179func TestConfigValidationCache(t *testing.T) {
180 jsonConfig := `{"databases": {"db": {"cache": {"rev_cache": {"size": 0}, "channel_cache": {"max_number": 100, "compact_high_watermark_pct": 95, "compact_low_watermark_pct": 25}}}}}`

Callers

nothing calls this directly

Calls 4

TestCtxFunction · 0.92
IsEnterpriseEditionFunction · 0.92
readLegacyServerConfigFunction · 0.85

Tested by

no test coverage detected