(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func 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 | |
| 130 | func TestHealthCheckOptionsToHealthConfigNoHealthcheck(t *testing.T) { |
| 131 | opt := healthCheckOptions{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…