MCPcopy Create free account
hub / github.com/docker/cli / TestHealthCheckOptionsToHealthConfig

Function TestHealthCheckOptionsToHealthConfig

cli/command/service/opts_test.go:108–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestHealthCheckOptionsToHealthConfig(t *testing.T) {
109 dur := time.Second
110 opt := healthCheckOptions{
111 cmd: "curl",
112 interval: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
113 timeout: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
114 startPeriod: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
115 startInterval: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
116 retries: 10,
117 }
118 config, err := opt.toHealthConfig()
119 assert.NilError(t, err)
120 assert.Check(t, is.DeepEqual(&container.HealthConfig{
121 Test: []string{"CMD-SHELL", "curl"},
122 Interval: time.Second,
123 Timeout: time.Second,
124 StartPeriod: time.Second,
125 StartInterval: time.Second,
126 Retries: 10,
127 }, config))
128}
129
130func TestHealthCheckOptionsToHealthConfigNoHealthcheck(t *testing.T) {
131 opt := healthCheckOptions{

Callers

nothing calls this directly

Calls 1

toHealthConfigMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…