From 63b795d1652025ab7843670cadc05e39c0b3995b Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 8 Jul 2020 17:16:31 +0530 Subject: [PATCH] e2e: provide an option to skip rbd and cephfs e2e Added two new parameters for e2e test to skip rbd and cephfs tests. This will help us to run more test in Travis CI. Signed-off-by: Madhu Rajanna --- e2e/README.md | 2 ++ e2e/cephfs.go | 6 ++++++ e2e/e2e_test.go | 2 ++ e2e/rbd.go | 6 ++++++ e2e/utils.go | 2 ++ 5 files changed, 18 insertions(+) diff --git a/e2e/README.md b/e2e/README.md index 63ca67c0d..e0a92c46f 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -78,6 +78,8 @@ are available while running tests: | deploy-timeout | Timeout to wait for created kubernetes resources (default: 10 minutes) | | deploy-cephfs | Deploy cephfs csi driver as part of E2E (default: true) | | deploy-rbd | Deploy rbd csi driver as part of E2E (default: true) | +| test-cephfs | Test cephfs csi driver as part of E2E (default: true) | +| test-rbd | Test rbd csi driver as part of E2E (default: true) | | cephcsi-namespace | The namespace in which cephcsi driver will be created (default: "default") | | rook-namespace | The namespace in which rook operator is installed (default: "rook-ceph") | | kubeconfig | Path to kubeconfig containing embedded authinfo (default: $HOME/.kube/config) | diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 9053abd55..d776724ae 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -115,6 +115,9 @@ var _ = Describe("cephfs", func() { var c clientset.Interface // deploy cephfs CSI BeforeEach(func() { + if !testCephFS { + Skip("Skipping CephFS E2E") + } c = f.ClientSet if deployCephFS { if cephCSINamespace != defaultNs { @@ -130,6 +133,9 @@ var _ = Describe("cephfs", func() { }) AfterEach(func() { + if !testRBD { + Skip("Skipping CephFS E2E") + } if CurrentGinkgoTestDescription().Failed { // log pods created by helm chart logsCSIPods("app=ceph-csi-cephfs", c) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index a3c700992..def681cdc 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -20,6 +20,8 @@ func init() { flag.IntVar(&deployTimeout, "deploy-timeout", 10, "timeout to wait for created kubernetes resources") flag.BoolVar(&deployCephFS, "deploy-cephfs", true, "deploy cephfs csi driver") flag.BoolVar(&deployRBD, "deploy-rbd", true, "deploy rbd csi driver") + flag.BoolVar(&testCephFS, "test-cephfs", true, "test cephfs csi driver") + flag.BoolVar(&testRBD, "test-rbd", true, "test rbd csi driver") flag.StringVar(&cephCSINamespace, "cephcsi-namespace", defaultNs, "namespace in which cephcsi deployed") flag.StringVar(&rookNamespace, "rook-namespace", "rook-ceph", "namespace in which rook is deployed") setDefaultKubeconfig() diff --git a/e2e/rbd.go b/e2e/rbd.go index 7875bd80a..b05137381 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -128,6 +128,9 @@ var _ = Describe("RBD", func() { var c clientset.Interface // deploy RBD CSI BeforeEach(func() { + if !testRBD { + Skip("Skipping RBD E2E") + } c = f.ClientSet if deployRBD { createNodeLabel(f, nodeRegionLabel, regionValue) @@ -147,6 +150,9 @@ var _ = Describe("RBD", func() { }) AfterEach(func() { + if !testRBD { + Skip("Skipping RBD E2E") + } if CurrentGinkgoTestDescription().Failed { // log pods created by helm chart logsCSIPods("app=ceph-csi-rbd", c) diff --git a/e2e/utils.go b/e2e/utils.go index deafedd8e..d84eb94ef 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -52,6 +52,8 @@ var ( deployTimeout int deployCephFS bool deployRBD bool + testCephFS bool + testRBD bool cephCSINamespace string rookNamespace string ns string