(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func TestConvertHealthcheck(t *testing.T) { |
| 151 | retries := uint64(10) |
| 152 | timeout := composetypes.Duration(30 * time.Second) |
| 153 | interval := composetypes.Duration(2 * time.Millisecond) |
| 154 | startPeriod := composetypes.Duration(time.Minute) |
| 155 | startInterval := composetypes.Duration(1 * time.Second) |
| 156 | |
| 157 | source := &composetypes.HealthCheckConfig{ |
| 158 | Test: []string{"EXEC", "touch", "/foo"}, |
| 159 | Timeout: &timeout, |
| 160 | Interval: &interval, |
| 161 | Retries: &retries, |
| 162 | StartPeriod: &startPeriod, |
| 163 | StartInterval: &startInterval, |
| 164 | } |
| 165 | expected := &container.HealthConfig{ |
| 166 | Test: source.Test, |
| 167 | Timeout: time.Duration(timeout), |
| 168 | Interval: time.Duration(interval), |
| 169 | StartPeriod: time.Duration(startPeriod), |
| 170 | StartInterval: time.Duration(startInterval), |
| 171 | Retries: 10, |
| 172 | } |
| 173 | |
| 174 | healthcheck, err := convertHealthcheck(source) |
| 175 | assert.NilError(t, err) |
| 176 | assert.Check(t, is.DeepEqual(expected, healthcheck)) |
| 177 | } |
| 178 | |
| 179 | func TestConvertHealthcheckDisable(t *testing.T) { |
| 180 | source := &composetypes.HealthCheckConfig{Disable: true} |
nothing calls this directly
no test coverage detected
searching dependent graphs…