ParallelTest runs Docker tests in parallel
(t *testing.T, specs []ContainerSpec, testFunc func(*testing.T, dktest.ContainerInfo))
| 42 | |
| 43 | // ParallelTest runs Docker tests in parallel |
| 44 | func ParallelTest(t *testing.T, specs []ContainerSpec, |
| 45 | testFunc func(*testing.T, dktest.ContainerInfo)) { |
| 46 | |
| 47 | for i, spec := range specs { |
| 48 | spec := spec // capture range variable, see https://goo.gl/60w3p2 |
| 49 | |
| 50 | // Only test against one version in short mode |
| 51 | // TODO: order is random, maybe always pick first version instead? |
| 52 | if i > 0 && testing.Short() { |
| 53 | t.Logf("Skipping %v in short mode", spec.ImageName) |
| 54 | } else { |
| 55 | t.Run(spec.ImageName, func(t *testing.T) { |
| 56 | t.Parallel() |
| 57 | dktest.Run(t, spec.ImageName, spec.Options, testFunc) |
| 58 | }) |
| 59 | } |
| 60 | } |
| 61 | } |
searching dependent graphs…