dktesting

package
v4.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2020 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParallelTest

func ParallelTest(t *testing.T, specs []ContainerSpec,
	testFunc func(*testing.T, dktest.ContainerInfo))

ParallelTest runs Docker tests in parallel

Example
package main

import (
	"context"
	"testing"

	"github.com/dhui/dktest"

	"github.com/solvedata/migrate/v4/dktesting"
)

func main() {
	t := &testing.T{} // Should actually be used in a Test

	var isReady = func(ctx context.Context, c dktest.ContainerInfo) bool {
		// Return true if the container is ready to run tests.
		// Don't block here though. Use the Context to timeout container ready checks.
		return true
	}

	dktesting.ParallelTest(t, []dktesting.ContainerSpec{{ImageName: "docker_image:9.6",
		Options: dktest.Options{ReadyFunc: isReady}}}, func(t *testing.T, c dktest.ContainerInfo) {
		// Run your test/s ...
		t.Fatal("...")
	})
}

Types

type ContainerSpec

type ContainerSpec struct {
	ImageName string
	Options   dktest.Options
}

ContainerSpec holds Docker testing setup specifications

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL