From 1e7e941dae541d13f25b74b188f9f40bd804f7e9 Mon Sep 17 00:00:00 2001 From: Vishnu kannan Date: Wed, 6 Apr 2016 16:49:40 -0700 Subject: [PATCH] Add an option to focus or skip tests in the node e2e makefile rule. Signed-off-by: Vishnu kannan --- Makefile | 8 ++++++-- hack/e2e-node-test.sh | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7b056878855..b87fcc7ade8 100644 --- a/Makefile +++ b/Makefile @@ -93,10 +93,14 @@ test_e2e: # Build and run node end-to-end tests. # +# Args: +# FOCUS: regexp that matches the tests to be run +# SKIP: regexp that matches the tests that needs to be skipped # Example: -# make test_e2e_node +# make test_e2e_node FOCUS=kubelet SKIP=container +# Build and run tests. test_e2e_node: - hack/e2e-node-test.sh + hack/e2e-node-test.sh FOCUS=$(FOCUS) SKIP=$(SKIP) .PHONY: test_e2e_node diff --git a/hack/e2e-node-test.sh b/hack/e2e-node-test.sh index 32f338bd9a0..87a94431dfc 100755 --- a/hack/e2e-node-test.sh +++ b/hack/e2e-node-test.sh @@ -18,6 +18,9 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env +focus=${FOCUS} +skip=${SKIP:-""} + ginkgo=$(kube::util::find-binary "ginkgo") if [[ -z "${ginkgo}" ]]; then echo "You do not appear to have ginkgo built. Try 'hack/build-go.sh github.com/onsi/ginkgo/ginkgo'" @@ -26,6 +29,6 @@ fi # Provided for backwards compatibility sudo -v -"${ginkgo}" "${KUBE_ROOT}/test/e2e_node/" -- --alsologtostderr --v 2 --node-name $(hostname) --build-services=true --start-services=true --stop-services=true +"${ginkgo}" --focus=$focus --skip=$skip "${KUBE_ROOT}/test/e2e_node/" -- --alsologtostderr --v 2 --node-name $(hostname) --build-services=true --start-services=true --stop-services=true exit $?