MCPcopy Index your code
hub / github.com/ContentSquare/chproxy / TestLoadConfig

Function TestLoadConfig

config/config_test.go:277–355  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

275}
276
277func TestLoadConfig(t *testing.T) {
278 var testCases = []struct {
279 name string
280 file string
281 cfg Config
282 }{
283 {
284 "full description",
285 "testdata/full.yml",
286
287 fullConfig,
288 },
289 {
290 "default values",
291 "testdata/default_values.yml",
292 Config{
293 Server: Server{
294 HTTP: HTTP{
295 ListenAddr: ":8080",
296 NetworksOrGroups: []string{"127.0.0.1"},
297 TimeoutCfg: TimeoutCfg{
298 ReadTimeout: Duration(time.Minute),
299 WriteTimeout: Duration(3 * time.Minute),
300 IdleTimeout: Duration(10 * time.Minute),
301 },
302 },
303 },
304 Clusters: []Cluster{
305 {
306 Name: "cluster",
307 Scheme: "http",
308 Nodes: []string{"127.0.0.1:8123"},
309 ClusterUsers: []ClusterUser{
310 {
311 Name: "default",
312 },
313 },
314 HeartBeat: HeartBeat{
315 Interval: Duration(5 * time.Second),
316 Timeout: Duration(3 * time.Second),
317 Request: "/ping",
318 Response: "Ok.\n",
319 },
320 RetryNumber: 0,
321 },
322 },
323 Users: []User{
324 {
325 Name: "default",
326 ToCluster: "cluster",
327 ToUser: "default",
328 MaxExecutionTime: Duration(120 * time.Second),
329 },
330 },
331 MaxErrorReasonSize: ByteSize(1 << 50),
332 },
333 },
334 }

Callers

nothing calls this directly

Calls 3

DurationTypeAlias · 0.85
ByteSizeTypeAlias · 0.85
LoadFileFunction · 0.85

Tested by

no test coverage detected