diff --git a/.travis.yml b/.travis.yml index 52b2220783c..5b615a467f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ jobs: install: - make goget-tools script: + - export PATH="$PATH:$GOPATH/bin" - make bin - make validate - make test-coverage diff --git a/Makefile b/Makefile index e745b03a72e..8a7e4fa78e6 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,13 @@ DEBUG_BUILD_FLAGS := -ldflags="$(COMMON_FLAGS)" FILES := odo dist TIMEOUT ?= 1800s +# 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 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 ginkgo test nodes. +TEST_EXEC_NODES ?= 4 + # Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow SLOW_SPEC_THRESHOLD := 120 @@ -59,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 diff --git a/scripts/openshiftci-presubmit-e2e.sh b/scripts/openshiftci-presubmit-e2e.sh index 8959c44ae9f..56a6b2681d4 100755 --- a/scripts/openshiftci-presubmit-e2e.sh +++ b/scripts/openshiftci-presubmit-e2e.sh @@ -9,7 +9,9 @@ export CI="openshift" export TIMEOUT="30m" make configure-installer-tests-cluster make bin -export PATH="$PATH:$(pwd)" +mkdir -p $GOPATH/bin +go get -u github.com/onsi/ginkgo/ginkgo +export PATH="$PATH:$(pwd):$GOPATH/bin" export CUSTOM_HOMEDIR="/tmp/artifacts" make test-generic make test-odo-login-e2e 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() {