Remove checks of test launching parameters
This commit is contained in:
parent
8ee5ff0189
commit
6d2225f9de
|
@ -5,8 +5,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDatastoreAcc(t *testing.T) {
|
func TestDatastoreAcc(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
d := newTestDriver(t)
|
d := newTestDriver(t)
|
||||||
ds, err := d.FindDatastore("datastore1", "")
|
ds, err := d.FindDatastore("datastore1", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package driver
|
package driver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -9,7 +8,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Defines whether acceptance tests should be run
|
// Defines whether acceptance tests should be run
|
||||||
const TestEnvVar = "VSPHERE_DRIVER_ACC"
|
|
||||||
const TestHostName = "esxi-1.vsphere65.test"
|
const TestHostName = "esxi-1.vsphere65.test"
|
||||||
|
|
||||||
func newTestDriver(t *testing.T) *Driver {
|
func newTestDriver(t *testing.T) *Driver {
|
||||||
|
@ -29,18 +27,3 @@ func newVMName() string {
|
||||||
rand.Seed(time.Now().UTC().UnixNano())
|
rand.Seed(time.Now().UTC().UnixNano())
|
||||||
return fmt.Sprintf("test-%v", rand.Intn(1000))
|
return fmt.Sprintf("test-%v", rand.Intn(1000))
|
||||||
}
|
}
|
||||||
|
|
||||||
func initDriverAcceptanceTest(t *testing.T) {
|
|
||||||
// We only run acceptance tests if an env var is set because they're
|
|
||||||
// slow and require outside configuration.
|
|
||||||
if os.Getenv(TestEnvVar) == "" {
|
|
||||||
t.Skip(fmt.Sprintf(
|
|
||||||
"Acceptance tests skipped unless env '%s' set",
|
|
||||||
TestEnvVar))
|
|
||||||
}
|
|
||||||
|
|
||||||
// We require verbose mode so that the user knows what is going on.
|
|
||||||
if !testing.Verbose() {
|
|
||||||
t.Fatal("Acceptance tests must be run with the -v flag on tests")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package driver
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestFolderAcc(t *testing.T) {
|
func TestFolderAcc(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
d := newTestDriver(t)
|
d := newTestDriver(t)
|
||||||
f, err := d.FindFolder("folder1/folder2")
|
f, err := d.FindFolder("folder1/folder2")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -5,8 +5,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHostAcc(t *testing.T) {
|
func TestHostAcc(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
d := newTestDriver(t)
|
d := newTestDriver(t)
|
||||||
host, err := d.FindHost(TestHostName)
|
host, err := d.FindHost(TestHostName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -3,8 +3,6 @@ package driver
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestResourcePoolAcc(t *testing.T) {
|
func TestResourcePoolAcc(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
d := newTestDriver(t)
|
d := newTestDriver(t)
|
||||||
p, err := d.FindResourcePool("","esxi-1.vsphere65.test", "pool1/pool2")
|
p, err := d.FindResourcePool("","esxi-1.vsphere65.test", "pool1/pool2")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -8,8 +8,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVMAcc_clone(t *testing.T) {
|
func TestVMAcc_clone(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
config *CloneConfig
|
config *CloneConfig
|
||||||
|
|
|
@ -6,8 +6,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVMAcc_create(t *testing.T) {
|
func TestVMAcc_create(t *testing.T) {
|
||||||
initDriverAcceptanceTest(t)
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
config *CreateConfig
|
config *CreateConfig
|
||||||
|
|
Loading…
Reference in New Issue