allow filtering driver integration tests

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2014-12-16 13:14:49 -05:00
parent 882f98dcc0
commit 93716e9d2b
1 changed files with 21 additions and 7 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"strings"
) )
type ( type (
@ -18,6 +19,16 @@ var (
) )
func init() { func init() {
// allow filtering driver tests
if machineTests := os.Getenv("MACHINE_TESTS"); machineTests != "" {
tests := strings.Split(machineTests, " ")
for _, test := range tests {
mcn := MachineDriver{
name: test,
}
machineTestDrivers = append(machineTestDrivers, mcn)
}
} else {
machineTestDrivers = []MachineDriver{ machineTestDrivers = []MachineDriver{
MachineDriver{ MachineDriver{
name: "virtualbox", name: "virtualbox",
@ -26,6 +37,9 @@ func init() {
name: "digitalocean", name: "digitalocean",
}, },
} }
}
// find machine binary
if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" { if machineBin := os.Getenv("MACHINE_BINARY"); machineBin != "" {
machineBinary = machineBin machineBinary = machineBin
} else { } else {