Skip to content

Commit

Permalink
Introducing test tags to avoid running test multiple times (vmware-ar…
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklanirdesh82 committed Jun 6, 2017
1 parent 2010701 commit 4bb5b42
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions misc/drone-scripts/deploy-and-test-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ pluginSanityCheck)
runtests)
if [ -e /tmp/$ESX ]
then
TARGET+=" e2e-dkrVolDriver-test test-vm"
TARGET+=" e2e-runalways-test test-vm"
else
touch /tmp/$ESX
TARGET+=" deploy-vm e2e-dkrVolDriver-test testasroot test-esx test-vm"
TARGET+=" deploy-vm e2e-runalways-test e2e-runonce-test testasroot test-esx test-vm"
fi
;;
esac
Expand Down
6 changes: 3 additions & 3 deletions misc/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ else
$DOCKER run --privileged --rm \
-e "PKG_VERSION=$PKG_VERSION" \
-e "INCLUDE_UI=$INCLUDE_UI" \
-e "ESX=$2" \
-e "VM1=$3" \
-e "VM2=$4" \
-e "ESX=$ESX" \
-e "VM1=$VM1" \
-e "VM2=$VM2" \
-e "GOVC_INSECURE=$GOVC_INSECURE" \
-e "GOVC_URL=$GOVC_URL" \
-e "GOVC_USERNAME=$GOVC_USERNAME" \
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// This test suite includes test cases to verify basic functionality
// in most common configurations

// +build runalways

package e2e

import (
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/defaultvmgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// This test suite tries to add, remove and replace vm to the _DEFAULT vmgroup
// Expected behavior is that add/rm/replace vm for _DEFAULT vmgroup should fail

// +build runonce

package e2e

import (
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// This test suite includes test cases involving restart docker and plugin. #1252
// End goal is to make sure volumes get detached smoothly in different scenarios

// +build runonce

package e2e

import (
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/swarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// This test suite includes test cases to verify basic vDVS functionality
// in docker swarm mode.

// +build runonce

package e2e

import (
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/vmlistener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// In case of vm/esx host restart vDVS cleans up stale attachment details
// the volume.

// +build runonce

package e2e

import (
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/volumepropverification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

// Test assumes that SSH cert has been setup to enable password-less login to VM and ESX.

// +build runalways

package e2e

import (
Expand Down
15 changes: 10 additions & 5 deletions vmdk_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ deploy: deploy-all
.PHONY: test
test:
$(log_target)
$(SCRIPTS)/build.sh testasroot
$(BUILD) testasroot

.PHONY: testasroot
testasroot:
Expand Down Expand Up @@ -350,12 +350,17 @@ test-all: test e2e-test testremote
# An end-to-end test target for vSphere Docker Volume Driver
e2e-test:
$(log_target)
$(SCRIPTS)/build.sh e2e-dkrVolDriver-test "$(ESX)" "$(VM1)" "$(VM2)"
$(BUILD) e2e-runalways-test
$(BUILD) e2e-runonce-test

.PHONY: e2e-dkrVolDriver-test
e2e-dkrVolDriver-test:
.PHONY: e2e-runalways-test e2e-runonce-test
e2e-runalways-test:
$(log_target)
$(GO) test $(E2E_Tests) -v -timeout 30m
$(GO) test -v -timeout 30m -tags runalways $(E2E_Tests)

e2e-runonce-test:
$(log_target)
$(GO) test -v -timeout 30m -tags runonce $(E2E_Tests)

MANAGED_PLUGIN_NAME="vsphere:latest"

Expand Down

0 comments on commit 4bb5b42

Please sign in to comment.