github.com/kubecost/golang-migrate-duckdb/v4@v4.17.0-duckdb.1/dktesting/example_test.go (about)

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