newTestUpstreamConfig creates a new UpstreamConfig with a single upstream address and default timeout.
( tb testing.TB, timeout time.Duration, addrs ...string, )
| 259 | // newTestUpstreamConfig creates a new UpstreamConfig with a single upstream |
| 260 | // address and default timeout. |
| 261 | func newTestUpstreamConfig( |
| 262 | tb testing.TB, |
| 263 | timeout time.Duration, |
| 264 | addrs ...string, |
| 265 | ) (u *UpstreamConfig) { |
| 266 | tb.Helper() |
| 267 | |
| 268 | upsConf, err := ParseUpstreamsConfig(addrs, &upstream.Options{ |
| 269 | Logger: testLogger, |
| 270 | Timeout: timeout, |
| 271 | }) |
| 272 | require.NoError(tb, err) |
| 273 | |
| 274 | return upsConf |
| 275 | } |
| 276 | |
| 277 | // mustStartDefaultProxy starts a new proxy with default settings and returns |
| 278 | // it. It fails the test on error. |
no test coverage detected
searching dependent graphs…