mirror of https://github.com/docker/docs.git
allow for arbitrary test interval
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
241a003315
commit
a0b3aab8b2
|
|
@ -9,9 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
machineName = "machine-integration-test-%s"
|
machineName = "machine-integration-test-%s"
|
||||||
waitInterval = 30
|
|
||||||
waitDuration = time.Duration(waitInterval * time.Second)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func machineCreate(name string, t *testing.T, wg *sync.WaitGroup) {
|
func machineCreate(name string, t *testing.T, wg *sync.WaitGroup) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
@ -16,6 +18,8 @@ type (
|
||||||
var (
|
var (
|
||||||
machineBinary = "machine"
|
machineBinary = "machine"
|
||||||
machineTestDrivers []MachineDriver
|
machineTestDrivers []MachineDriver
|
||||||
|
waitInterval int
|
||||||
|
waitDuration time.Duration
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -39,6 +43,19 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interval := os.Getenv("MACHINE_TEST_DURATION")
|
||||||
|
if interval == "" {
|
||||||
|
interval = "30"
|
||||||
|
}
|
||||||
|
wait, err := strconv.Atoi(interval)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("invalid interval: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
waitInterval = wait
|
||||||
|
waitDuration = time.Duration(time.Duration(waitInterval) * time.Second)
|
||||||
|
|
||||||
// find machine binary
|
// find machine binary
|
||||||
if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" {
|
if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" {
|
||||||
machineBinary = machineBin
|
machineBinary = machineBin
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue