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

Function TestConfigEndpoint

rest/adminapitest/admin_api_test.go:2476–2649  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2474}
2475
2476func TestConfigEndpoint(t *testing.T) {
2477 testCases := []struct {
2478 Name string
2479 Config string
2480 ConsoleLevel base.LogLevel
2481 ConsoleLogKeys []string
2482 ExpectError bool
2483 FileLoggerCheckFn func() bool
2484 }{
2485 {
2486 Name: "Set LogLevel and LogKeys",
2487 Config: `
2488 {
2489 "logging": {
2490 "console": {
2491 "log_level": "trace",
2492 "log_keys": ["Config"]
2493 }
2494 }
2495 }`,
2496 ConsoleLevel: base.LevelTrace,
2497 ConsoleLogKeys: []string{"Config"},
2498 ExpectError: false,
2499 },
2500 {
2501 Name: "Set LogLevel and multiple LogKeys",
2502 Config: `
2503 {
2504 "logging": {
2505 "console": {
2506 "log_level": "info",
2507 "log_keys": ["Config", "HTTP+"]
2508 }
2509 }
2510 }`,
2511 ConsoleLevel: base.LevelInfo,
2512 ConsoleLogKeys: []string{"Config", "HTTP"},
2513 ExpectError: false,
2514 },
2515 {
2516 Name: "Set Invalid Fields",
2517 Config: `
2518 {
2519 "logging": {
2520 "console": {
2521 "log_level": "info",
2522 "log_keys": ["Config", "HTTP+"]
2523 },
2524 "fake": {}
2525 }
2526 }`,
2527 ConsoleLevel: base.LevelTrace,
2528 ConsoleLogKeys: []string{"Config"},
2529 ExpectError: true,
2530 },
2531 {
2532 Name: "Set non-runtime configurable Fields",
2533 Config: `

Callers

nothing calls this directly

Calls 15

CloseMethod · 0.95
SendAdminRequestMethod · 0.95
ErrorLoggerIsEnabledFunction · 0.92
WarnLoggerIsEnabledFunction · 0.92
InfoLoggerIsEnabledFunction · 0.92
DebugLoggerIsEnabledFunction · 0.92
TraceLoggerIsEnabledFunction · 0.92
StatsLoggerIsEnabledFunction · 0.92
ResetGlobalTestLoggingFunction · 0.92
SetUpTestLoggingFunction · 0.92
InitializeMemoryLoggersFunction · 0.92
DefaultStartupConfigFunction · 0.92

Tested by

no test coverage detected