...
1 package dktesting
2
3 import (
4 "testing"
5 )
6
7 import (
8 "github.com/dhui/dktest"
9 )
10
11
12 type ContainerSpec struct {
13 ImageName string
14 Options dktest.Options
15 }
16
17
18 func ParallelTest(t *testing.T, specs []ContainerSpec,
19 testFunc func(*testing.T, dktest.ContainerInfo)) {
20
21 for i, spec := range specs {
22 spec := spec
23
24
25
26 if i > 0 && testing.Short() {
27 t.Logf("Skipping %v in short mode", spec.ImageName)
28 } else {
29 t.Run(spec.ImageName, func(t *testing.T) {
30 t.Parallel()
31 dktest.Run(t, spec.ImageName, spec.Options, testFunc)
32 })
33 }
34 }
35 }
36
View as plain text