From b786ab7452a666e198652ea412818bb985a489d3 Mon Sep 17 00:00:00 2001 From: arout Date: Wed, 22 May 2019 17:12:46 +0530 Subject: [PATCH 01/21] Running spec parallelly for clean test template --- .travis.yml | 1 + Makefile | 10 ++++++++++ scripts/openshiftci-presubmit-e2e.sh | 1 + 3 files changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 52b2220783c..21ff0e57589 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ jobs: - make bin - sudo cp odo /usr/bin - oc login -u developer + - travis_wait make clean-test - travis_wait make test-generic - travis_wait make test-odo-login-e2e - travis_wait make test-cmp-e2e diff --git a/Makefile b/Makefile index e745b03a72e..0fede2735e8 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ BUILD_FLAGS := -ldflags="-w $(COMMON_FLAGS)" DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" FILES := odo dist TIMEOUT ?= 1800s +SPEC_EXEC_METHOD ?= # Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow SLOW_SPEC_THRESHOLD := 120 @@ -93,6 +94,15 @@ configure-installer-tests-cluster: test: go test -race $(PKGS) +# Run generic integration tests +.PHONY: clean-test +clean-test: +ifeq ($(SPEC_EXEC_METHOD),series) + go test -v github.com/openshift/odo/tests/template --ginkgo.focus="Example of a clean test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) +else + ginkgo -v -nodes=4 -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ +endif + # Run generic integration tests .PHONY: test-generic test-generic: diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 8959c44ae9f..35ff84207a6 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -11,6 +11,7 @@ make configure-installer-tests-cluster make bin export PATH="$PATH:$(pwd)" export CUSTOM_HOMEDIR="/tmp/artifacts" +make clean-test make test-generic make test-odo-login-e2e make test-json-format-output From a3ba01d9d9785670e671b40221e05466b9262c76 Mon Sep 17 00:00:00 2001 From: arout Date: Wed, 22 May 2019 19:30:59 +0530 Subject: [PATCH 02/21] Exporting GOPATH --- scripts/openshiftci-presubmit-e2e.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 35ff84207a6..95ee8dff201 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -9,7 +9,8 @@ export CI="openshift" export TIMEOUT="30m" make configure-installer-tests-cluster make bin -export PATH="$PATH:$(pwd)" +echo $GOPATH +export PATH="$PATH:$(pwd):$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" make clean-test make test-generic From 17984717be2c3921a3413a0fdfac6ec187f55c8a Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 23 May 2019 14:48:44 +0530 Subject: [PATCH 03/21] Installing ginkgo binary --- scripts/openshiftci-presubmit-e2e.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 95ee8dff201..af2c960acc5 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -10,6 +10,9 @@ export TIMEOUT="30m" make configure-installer-tests-cluster make bin echo $GOPATH +mkdir -p $GOPATH/bin +go get -u github.com/onsi/ginkgo/ginkgo +ls $GOPATH/bin export PATH="$PATH:$(pwd):$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" make clean-test From 25c7950b2f1de99a193707d40da93904a669e64e Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 23 May 2019 17:36:39 +0530 Subject: [PATCH 04/21] Removed debug line --- scripts/openshiftci-presubmit-e2e.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index af2c960acc5..56a6b2681d4 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -9,13 +9,10 @@ export CI="openshift" export TIMEOUT="30m" make configure-installer-tests-cluster make bin -echo $GOPATH mkdir -p $GOPATH/bin go get -u github.com/onsi/ginkgo/ginkgo -ls $GOPATH/bin export PATH="$PATH:$(pwd):$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" -make clean-test make test-generic make test-odo-login-e2e make test-json-format-output From 0e2d63f8cdead91ba4d17a6d7afb977baf5d5328 Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 23 May 2019 17:51:43 +0530 Subject: [PATCH 05/21] Removed clean test template reference from travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 21ff0e57589..52b2220783c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,6 @@ jobs: - make bin - sudo cp odo /usr/bin - oc login -u developer - - travis_wait make clean-test - travis_wait make test-generic - travis_wait make test-odo-login-e2e - travis_wait make test-cmp-e2e From e9c8a8f6ed184cdbbb66cdfaf55e49ac2410603b Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 23 May 2019 17:56:28 +0530 Subject: [PATCH 06/21] Updated test comment in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0fede2735e8..ca260f9b7e9 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,7 @@ configure-installer-tests-cluster: test: go test -race $(PKGS) -# Run generic integration tests +# Run clean test template spec parallelly .PHONY: clean-test clean-test: ifeq ($(SPEC_EXEC_METHOD),series) From 901da3e7b1287fa432e77e2824a9b2e79bfe3329 Mon Sep 17 00:00:00 2001 From: arout Date: Fri, 24 May 2019 12:46:01 +0530 Subject: [PATCH 07/21] Updated doc changes for env var SPEC_EXEC_METHOD --- docs/development.adoc | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/docs/development.adoc b/docs/development.adoc index 91a74b78e30..72c2a46420e 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -160,33 +160,22 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena .Procedure: -To deploy an integration test: +Integration tests can be run in the following two ways: - -* For the entire integration suite use: ----- -$ make test-e2e ----- - -* For the generic tests use: ----- -$ make test-generic ----- - -* For the component tests use: +* To run the test spec parallelly (default): ++ ---- -$ make test-cmp-e2e +$ make clean-test ---- ++ -* For the service catalog tests use: +* To run the test spec sequentially use enviornment variable `SPEC_EXEC_METHOD`: ++ ---- -$ make test-service-e2e +$ make clean-test SPEC_EXEC_METHOD=series ---- -* For the e2e scenario test use: ----- -$ make test-e2e-scenarios ----- +NOTE: Currently only the clean test template is configured with environment variable `SPEC_EXEC_METHOD` and rest of the test does not honour this environment variable. So by default rest of the test runs sequencially. You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs From 6b393bc2bd9b6f68fcc2e1e1e87da6fe94858136 Mon Sep 17 00:00:00 2001 From: arout Date: Mon, 27 May 2019 12:29:34 +0530 Subject: [PATCH 08/21] Adding more info to test description --- docs/development.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development.adoc b/docs/development.adoc index 72c2a46420e..0bdb55df66f 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -162,14 +162,14 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena Integration tests can be run in the following two ways: -* To run the test spec parallelly (default): +* To run the template spec parallelly (default): + ---- $ make clean-test ---- + -* To run the test spec sequentially use enviornment variable `SPEC_EXEC_METHOD`: +* To run the template spec sequentially use enviornment variable `SPEC_EXEC_METHOD`: + ---- $ make clean-test SPEC_EXEC_METHOD=series From 16e6e27489858c12721368ff4868d6f280154182 Mon Sep 17 00:00:00 2001 From: arout Date: Mon, 27 May 2019 15:38:34 +0530 Subject: [PATCH 09/21] Updated description --- docs/development.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.adoc b/docs/development.adoc index 0bdb55df66f..68f31c11375 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -162,7 +162,7 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena Integration tests can be run in the following two ways: -* To run the template spec parallelly (default): +* To run the template spec in parallel (default): + ---- $ make clean-test From 321b091bb5c7887067ea48e594392eada6d0fec1 Mon Sep 17 00:00:00 2001 From: arout Date: Mon, 27 May 2019 19:56:28 +0530 Subject: [PATCH 10/21] Added TIMEOUT --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca260f9b7e9..47c11e93153 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ clean-test: ifeq ($(SPEC_EXEC_METHOD),series) go test -v github.com/openshift/odo/tests/template --ginkgo.focus="Example of a clean test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) else - ginkgo -v -nodes=4 -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ + ginkgo -v -nodes=4 -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ -timeout $(TIMEOUT) endif # Run generic integration tests From 9ce76981842761f4674106085e4c0b1174b0d68a Mon Sep 17 00:00:00 2001 From: arout Date: Tue, 28 May 2019 14:54:24 +0530 Subject: [PATCH 11/21] Added GLOBALODOCONFIG for global config isolation --- tests/template/template_cleantest_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/template/template_cleantest_test.go b/tests/template/template_cleantest_test.go index 4a211c4b0f9..6b74b6c254f 100644 --- a/tests/template/template_cleantest_test.go +++ b/tests/template/template_cleantest_test.go @@ -1,6 +1,7 @@ package template import ( + "os" "path/filepath" "time" @@ -20,10 +21,7 @@ var _ = Describe("Example of a clean test", func() { // current directory and project (before eny test is run) so it can restored after all testing is done var originalDir string var originalProject string - var oc helper.OcRunner - // path to odo binary - //var odo string BeforeEach(func() { // Set default timeout for Eventually assertions @@ -33,15 +31,16 @@ var _ = Describe("Example of a clean test", func() { // initialize oc runner // right now it uses oc binary, but we should convert it to client-go oc = helper.NewOcRunner("oc") - //odo = "odo" - - project = helper.CreateRandProject() context = helper.CreateNewContext() + os.Setenv("GLOBALODOCONFIG", filepath.Join(context, "config.yaml")) + project = helper.CreateRandProject() + }) AfterEach(func() { helper.DeleteProject(project) helper.DeleteDir(context) + os.Unsetenv("GLOBALODOCONFIG") }) var _ = Context("when component is in the current directory", func() { From 3fc64bf1f009b51def3437ddb9b875af18ce4713 Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 30 May 2019 16:49:53 +0530 Subject: [PATCH 12/21] Fixed review comments --- Makefile | 6 ++++++ scripts/openshiftci-presubmit-e2e.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 47c11e93153..49d6bea875f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ BUILD_FLAGS := -ldflags="-w $(COMMON_FLAGS)" DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" FILES := odo dist TIMEOUT ?= 1800s + +# Env variable SPEC_EXEC_METHOD can be used to pass spec exeution type +# (parallel or sequential) for ginkgo tests. To run the specs sequentially use +# SPEC_EXEC_METHOD=series, otherwise specs run in parallel on 4 node. SPEC_EXEC_METHOD ?= # Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow @@ -168,6 +172,8 @@ test-odo-login-e2e: test-odo-config: go test -v github.com/openshift/odo/tests/integration --ginkgo.focus="odo config test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) +# Yet to decide on this test. Discussion is being tracked in +# https://github.com/openshift/odo/issues/1769 # Run all e2e tests .PHONY: test-e2e test-e2e: diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 56a6b2681d4..37419d50f96 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -11,7 +11,7 @@ make configure-installer-tests-cluster make bin mkdir -p $GOPATH/bin go get -u github.com/onsi/ginkgo/ginkgo -export PATH="$PATH:$(pwd):$GOPATH/bin" +export PATH="$PATH:$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" make test-generic make test-odo-login-e2e From beb9aa74b28db73992d140fb2e7b28dfa6405310 Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 30 May 2019 17:42:00 +0530 Subject: [PATCH 13/21] Added test node env var and updated doc --- Makefile | 16 ++++++++-------- docs/development.adoc | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 49d6bea875f..18d4b203d66 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,12 @@ DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" FILES := odo dist TIMEOUT ?= 1800s -# Env variable SPEC_EXEC_METHOD can be used to pass spec exeution type +# Env variable TEST_EXEC_NODES is used to pass spec exeution type # (parallel or sequential) for ginkgo tests. To run the specs sequentially use -# SPEC_EXEC_METHOD=series, otherwise specs run in parallel on 4 node. -SPEC_EXEC_METHOD ?= +# TEST_EXEC_NODES=1, otherwise bydefault the specs are run in parallel on 4 node. +# NOTE: Any TEST_EXEC_NODES value greater than one runs the spec in parallel +# on the same number of node. +TEST_EXEC_NODES ?= 4 # Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow SLOW_SPEC_THRESHOLD := 120 @@ -98,14 +100,12 @@ configure-installer-tests-cluster: test: go test -race $(PKGS) +# This test is only for reference and will be removed +# in the subsequent subtask of https://github.com/openshift/odo/issues/1473 # Run clean test template spec parallelly .PHONY: clean-test clean-test: -ifeq ($(SPEC_EXEC_METHOD),series) - go test -v github.com/openshift/odo/tests/template --ginkgo.focus="Example of a clean test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) -else - ginkgo -v -nodes=4 -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ -timeout $(TIMEOUT) -endif + ginkgo -v -nodes=$(TEST_EXEC_NODES) -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ -timeout $(TIMEOUT) # Run generic integration tests .PHONY: test-generic diff --git a/docs/development.adoc b/docs/development.adoc index 68f31c11375..d76e128b579 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -162,20 +162,20 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena Integration tests can be run in the following two ways: -* To run the template spec in parallel (default): +* To run the template spec in parallel (default) on `4` test node : + ---- $ make clean-test ---- + -* To run the template spec sequentially use enviornment variable `SPEC_EXEC_METHOD`: +* To run the template spec sequentially or on single test node use enviornment variable `TEST_EXEC_NODES`: + ---- -$ make clean-test SPEC_EXEC_METHOD=series +$ make clean-test SPEC_EXEC_METHOD=1 ---- -NOTE: Currently only the clean test template is configured with environment variable `SPEC_EXEC_METHOD` and rest of the test does not honour this environment variable. So by default rest of the test runs sequencially. +NOTE: Currently only the clean test template is configured with environment variable `TEST_EXEC_NODES` and rest of the test like `make test-cmp-e2e` and others does not honour this environment variable. So by default rest of the test runs sequencially. You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs From 02148e60592c749e95eeec95bd943e9f8cf4841f Mon Sep 17 00:00:00 2001 From: arout Date: Thu, 30 May 2019 18:51:48 +0530 Subject: [PATCH 14/21] Added pwd in PATH --- scripts/openshiftci-presubmit-e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 37419d50f96..56a6b2681d4 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -11,7 +11,7 @@ make configure-installer-tests-cluster make bin mkdir -p $GOPATH/bin go get -u github.com/onsi/ginkgo/ginkgo -export PATH="$PATH:$GOPATH/bin" +export PATH="$PATH:$(pwd):$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" make test-generic make test-odo-login-e2e From 48c65e14949e61c12a62c9a871c73f179d18ccc5 Mon Sep 17 00:00:00 2001 From: arout Date: Fri, 31 May 2019 15:29:34 +0530 Subject: [PATCH 15/21] Removed test template form Makefile --- Makefile | 7 ------- docs/development.adoc | 12 +++++++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 18d4b203d66..be59cb17ca8 100644 --- a/Makefile +++ b/Makefile @@ -100,13 +100,6 @@ configure-installer-tests-cluster: test: go test -race $(PKGS) -# This test is only for reference and will be removed -# in the subsequent subtask of https://github.com/openshift/odo/issues/1473 -# Run clean test template spec parallelly -.PHONY: clean-test -clean-test: - ginkgo -v -nodes=$(TEST_EXEC_NODES) -focus="Example of a clean test" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/template/ -timeout $(TIMEOUT) - # Run generic integration tests .PHONY: test-generic test-generic: diff --git a/docs/development.adoc b/docs/development.adoc index d76e128b579..e9aa4e52ae2 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -158,25 +158,27 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena * `odo` and `oc` binaries in `$PATH`. +.How to write: + +Refer odo clean test link:https://github.com/openshift/odo/blob/master/tests/template/template_cleantest_test.go[`template`]. + .Procedure: Integration tests can be run in the following two ways: -* To run the template spec in parallel (default) on `4` test node : +* To run component test spec in parallel (default) on `4` test node : + ---- -$ make clean-test +$ make test-cmp-e2e ---- + -* To run the template spec sequentially or on single test node use enviornment variable `TEST_EXEC_NODES`: +* To run component test spec sequentially or on single test node use enviornment variable `TEST_EXEC_NODES`: + ---- $ make clean-test SPEC_EXEC_METHOD=1 ---- -NOTE: Currently only the clean test template is configured with environment variable `TEST_EXEC_NODES` and rest of the test like `make test-cmp-e2e` and others does not honour this environment variable. So by default rest of the test runs sequencially. - You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs === Race conditions From 713af19166e84ae09221438c3c3a2a6aa19f8b75 Mon Sep 17 00:00:00 2001 From: arout Date: Fri, 31 May 2019 16:21:36 +0530 Subject: [PATCH 16/21] Updated doc --- docs/development.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.adoc b/docs/development.adoc index e9aa4e52ae2..93b424d3a9e 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -176,7 +176,7 @@ $ make test-cmp-e2e * To run component test spec sequentially or on single test node use enviornment variable `TEST_EXEC_NODES`: + ---- -$ make clean-test SPEC_EXEC_METHOD=1 +$ make test-cmp-e2e TEST_EXEC_NODES=1 ---- You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs From fe082b9178316ed95041c64e9ff4442eb7babaf2 Mon Sep 17 00:00:00 2001 From: arout Date: Wed, 5 Jun 2019 12:27:42 +0530 Subject: [PATCH 17/21] Documentation and description updated --- Makefile | 14 ++++++-------- docs/development.adoc | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index be59cb17ca8..71c9c7ceffb 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" FILES := odo dist TIMEOUT ?= 1800s -# Env variable TEST_EXEC_NODES is used to pass spec exeution type +# Env variable TEST_EXEC_NODES is used to pass spec execution type # (parallel or sequential) for ginkgo tests. To run the specs sequentially use -# TEST_EXEC_NODES=1, otherwise bydefault the specs are run in parallel on 4 node. +# TEST_EXEC_NODES=1, otherwise by default the specs are run in parallel on 4 ginkgo test node. # NOTE: Any TEST_EXEC_NODES value greater than one runs the spec in parallel -# on the same number of node. +# on the same number of ginkgo test nodes. TEST_EXEC_NODES ?= 4 # Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow @@ -165,11 +165,9 @@ test-odo-login-e2e: test-odo-config: go test -v github.com/openshift/odo/tests/integration --ginkgo.focus="odo config test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) -# Yet to decide on this test. Discussion is being tracked in -# https://github.com/openshift/odo/issues/1769 -# Run all e2e tests -.PHONY: test-e2e -test-e2e: +# Run all integration tests +.PHONY: test-integration +test-integration: go test -v github.com/openshift/odo/tests/integration -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) # Run e2e test scenarios diff --git a/docs/development.adoc b/docs/development.adoc index 93b424d3a9e..6430dbb5f9c 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -160,20 +160,20 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena .How to write: -Refer odo clean test link:https://github.com/openshift/odo/blob/master/tests/template/template_cleantest_test.go[`template`]. +Refer to the odo clean test link:https://github.com/openshift/odo/blob/master/tests/template/template_cleantest_test.go[`template`]. .Procedure: Integration tests can be run in the following two ways: -* To run component test spec in parallel (default) on `4` test node : +* To run the component test in parallel (default: 4 ginkgo test node), on a test cluster : + ---- $ make test-cmp-e2e ---- + -* To run component test spec sequentially or on single test node use enviornment variable `TEST_EXEC_NODES`: +* To run component test sequentially or on single ginkgo test node use enviornment variable `TEST_EXEC_NODES`: + ---- $ make test-cmp-e2e TEST_EXEC_NODES=1 From 3d060dacc3d618ebd93710ad9078cee0fa27e677 Mon Sep 17 00:00:00 2001 From: arout Date: Wed, 5 Jun 2019 20:54:41 +0530 Subject: [PATCH 18/21] Added ginkgo in travis CI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 52b2220783c..83bded1c39f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,9 @@ jobs: go: "1.11.2" install: - make goget-tools + - go get -u github.com/onsi/ginkgo/ginkgo script: + - export PATH="$PATH:$GOPATH/bin" - make bin - make validate - make test-coverage From d86f667cb40da8da5a84d4f1fd43fbb89cb8253d Mon Sep 17 00:00:00 2001 From: arout Date: Mon, 10 Jun 2019 12:23:42 +0530 Subject: [PATCH 19/21] Made ginkgo installation part of goget-tools --- .travis.yml | 1 - Makefile | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83bded1c39f..5b615a467f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ jobs: go: "1.11.2" install: - make goget-tools - - go get -u github.com/onsi/ginkgo/ginkgo script: - export PATH="$PATH:$GOPATH/bin" - make bin diff --git a/Makefile b/Makefile index 71c9c7ceffb..28958e8adb3 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ goget-tools: # go get -u golang.org/x/lint/golint go get -u github.com/mitchellh/gox go get github.com/frapposelli/wwhrd + go get -u github.com/onsi/ginkgo/ginkgo # Run unit tests and collect coverage .PHONY: test-coverage From 72d334f6b338f2c595aa4d437932c2d76dd54947 Mon Sep 17 00:00:00 2001 From: arout Date: Tue, 11 Jun 2019 12:16:48 +0530 Subject: [PATCH 20/21] Added doc for test-integration --- Makefile | 2 +- docs/development.adoc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28958e8adb3..86f5f9ab99b 100644 --- a/Makefile +++ b/Makefile @@ -169,7 +169,7 @@ test-odo-config: # Run all integration tests .PHONY: test-integration test-integration: - go test -v github.com/openshift/odo/tests/integration -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) + ginkgo -v -nodes=$(TEST_EXEC_NODES) -focus="Integration Suite" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/integration/ -timeout $(TIMEOUT) # Run e2e test scenarios .PHONY: test-e2e-scenarios diff --git a/docs/development.adoc b/docs/development.adoc index 6430dbb5f9c..9e9b87d26f1 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -178,6 +178,20 @@ $ make test-cmp-e2e ---- $ make test-cmp-e2e TEST_EXEC_NODES=1 ---- ++ + +* To run the integration test suite in parallel (default: 4 ginkgo test node), on a test cluster : ++ +---- +$ make test-integration +---- ++ + +* To run the integration test suite sequentially or on single ginkgo test node use enviornment variable `TEST_EXEC_NODES`: ++ +---- +$ make test-integration TEST_EXEC_NODES=1 +---- You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs From e596a111871c3deef013bbb7b85eb7bfbe3d6311 Mon Sep 17 00:00:00 2001 From: arout Date: Wed, 12 Jun 2019 12:09:25 +0530 Subject: [PATCH 21/21] Updated doc and Makefile --- Makefile | 8 ++++---- docs/development.adoc | 33 ++++++++++++++------------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 86f5f9ab99b..8a7e4fa78e6 100644 --- a/Makefile +++ b/Makefile @@ -166,10 +166,10 @@ test-odo-login-e2e: test-odo-config: go test -v github.com/openshift/odo/tests/integration --ginkgo.focus="odo config test" -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) -# Run all integration tests -.PHONY: test-integration -test-integration: - ginkgo -v -nodes=$(TEST_EXEC_NODES) -focus="Integration Suite" slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/integration/ -timeout $(TIMEOUT) +# Run all e2e tests +.PHONY: test-e2e +test-e2e: + go test -v github.com/openshift/odo/tests/integration -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT) # Run e2e test scenarios .PHONY: test-e2e-scenarios diff --git a/docs/development.adoc b/docs/development.adoc index 9e9b87d26f1..91a74b78e30 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -158,39 +158,34 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena * `odo` and `oc` binaries in `$PATH`. -.How to write: +.Procedure: -Refer to the odo clean test link:https://github.com/openshift/odo/blob/master/tests/template/template_cleantest_test.go[`template`]. +To deploy an integration test: -.Procedure: -Integration tests can be run in the following two ways: +* For the entire integration suite use: +---- +$ make test-e2e +---- -* To run the component test in parallel (default: 4 ginkgo test node), on a test cluster : -+ +* For the generic tests use: ---- -$ make test-cmp-e2e +$ make test-generic ---- -+ -* To run component test sequentially or on single ginkgo test node use enviornment variable `TEST_EXEC_NODES`: -+ +* For the component tests use: ---- -$ make test-cmp-e2e TEST_EXEC_NODES=1 +$ make test-cmp-e2e ---- -+ -* To run the integration test suite in parallel (default: 4 ginkgo test node), on a test cluster : -+ +* For the service catalog tests use: ---- -$ make test-integration +$ make test-service-e2e ---- -+ -* To run the integration test suite sequentially or on single ginkgo test node use enviornment variable `TEST_EXEC_NODES`: -+ +* For the e2e scenario test use: ---- -$ make test-integration TEST_EXEC_NODES=1 +$ make test-e2e-scenarios ---- You can run a subset of tests with ginkgo by using focused specs mechanism https://onsi.github.io/ginkgo/#focused-specs