Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
allow for arbitrary test interval
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
  • Loading branch information
ehazlett committed Jan 13, 2015
1 parent 241a003 commit a0b3aab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 1 addition & 3 deletions _integration-test/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import (
)

const (
machineName = "machine-integration-test-%s"
waitInterval = 30
waitDuration = time.Duration(waitInterval * time.Second)
machineName = "machine-integration-test-%s"
)

func machineCreate(name string, t *testing.T, wg *sync.WaitGroup) {
Expand Down
17 changes: 17 additions & 0 deletions _integration-test/test_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"time"
)

type (
Expand All @@ -16,6 +18,8 @@ type (
var (
machineBinary = "machine"
machineTestDrivers []MachineDriver
waitInterval int
waitDuration time.Duration
)

func init() {
Expand All @@ -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
if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" {
machineBinary = machineBin
Expand Down

0 comments on commit a0b3aab

Please sign in to comment.