(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestLoadLogging(t *testing.T) { |
| 31 | loggingCases := []struct { |
| 32 | name string |
| 33 | loggingBase map[string]any |
| 34 | loggingOverride map[string]any |
| 35 | expected *types.LoggingConfig |
| 36 | }{ |
| 37 | { |
| 38 | name: "no_override_driver", |
| 39 | loggingBase: map[string]any{ |
| 40 | "logging": map[string]any{ |
| 41 | "driver": "json-file", |
| 42 | "options": map[string]any{ |
| 43 | "frequency": "2000", |
| 44 | "timeout": "23", |
| 45 | }, |
| 46 | }, |
| 47 | }, |
| 48 | loggingOverride: map[string]any{ |
| 49 | "logging": map[string]any{ |
| 50 | "options": map[string]any{ |
| 51 | "timeout": "360", |
| 52 | "pretty-print": "on", |
| 53 | }, |
| 54 | }, |
| 55 | }, |
| 56 | expected: &types.LoggingConfig{ |
| 57 | Driver: "json-file", |
| 58 | Options: map[string]string{ |
| 59 | "frequency": "2000", |
| 60 | "timeout": "360", |
| 61 | "pretty-print": "on", |
| 62 | }, |
| 63 | }, |
| 64 | }, |
| 65 | { |
| 66 | name: "override_driver", |
| 67 | loggingBase: map[string]any{ |
| 68 | "logging": map[string]any{ |
| 69 | "driver": "json-file", |
| 70 | "options": map[string]any{ |
| 71 | "frequency": "2000", |
| 72 | "timeout": "23", |
| 73 | }, |
| 74 | }, |
| 75 | }, |
| 76 | loggingOverride: map[string]any{ |
| 77 | "logging": map[string]any{ |
| 78 | "driver": "syslog", |
| 79 | "options": map[string]any{ |
| 80 | "timeout": "360", |
| 81 | "pretty-print": "on", |
| 82 | }, |
| 83 | }, |
| 84 | }, |
| 85 | expected: &types.LoggingConfig{ |
| 86 | Driver: "syslog", |
| 87 | Options: map[string]string{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…