github.com/nokia/migrate/v4@v4.16.0/dktesting/example_test.go (about) 1 package dktesting_test 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/dhui/dktest" 8 "github.com/nokia/migrate/v4/dktesting" 9 ) 10 11 func ExampleParallelTest() { 12 t := &testing.T{} // Should actually be used in a Test 13 14 isReady := func(ctx context.Context, c dktest.ContainerInfo) bool { 15 // Return true if the container is ready to run tests. 16 // Don't block here though. Use the Context to timeout container ready checks. 17 return true 18 } 19 20 dktesting.ParallelTest(t, []dktesting.ContainerSpec{{ 21 ImageName: "docker_image:9.6", 22 Options: dktest.Options{ReadyFunc: isReady}, 23 }}, func(t *testing.T, c dktest.ContainerInfo) { 24 // Run your test/s ... 25 t.Fatal("...") 26 }) 27 }