Skip to content

Commit

Permalink
use ginkgo binary for tests
Browse files Browse the repository at this point in the history
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
  • Loading branch information
anandrkskd committed Jun 20, 2022
1 parent 28c0906 commit a0fc119
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .ibm/pipelines/kubernetes-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cleanup_namespaces

(
set -e
make goget-ginkgo
make install
make test-integration-devfile
make test-interactive
Expand Down
1 change: 1 addition & 0 deletions .ibm/pipelines/openshift-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cleanup_namespaces

(
set -e
make goget-ginkgo
make install
make test-integration
make test-interactive
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
endif

# Slow spec threshold for ginkgo tests. After this time (in second), ginkgo marks test as slow
SLOW_SPEC_THRESHOLD := 120
SLOW_SPEC_THRESHOLD := 120s

# Env variable GINKGO_TEST_ARGS is used to get control over enabling ginkgo test flags against each test target run.
# For example:
Expand All @@ -45,15 +45,15 @@ export ODO_LOG_LEVEL ?= 4
# To enable verbosity export or set env GINKGO_TEST_ARGS like "GINKGO_TEST_ARGS=-v"
UNIT_TEST_ARGS ?=

GINKGO_FLAGS_ALL = $(GINKGO_TEST_ARGS) -randomizeAllSpecs -slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -timeout $(TIMEOUT)
GINKGO_FLAGS_ALL = $(GINKGO_TEST_ARGS) --randomize-all -slow-spec-threshold=$(SLOW_SPEC_THRESHOLD) -timeout $(TIMEOUT)

# Flags for tests that must not be run in parallel.
GINKGO_FLAGS_SERIAL = $(GINKGO_FLAGS_ALL) -nodes=1
# Flags for tests that may be run in parallel
GINKGO_FLAGS=$(GINKGO_FLAGS_ALL) -nodes=$(TEST_EXEC_NODES)


RUN_GINKGO = GOFLAGS='-mod=vendor' go run $(COMMON_GOFLAGS) github.com/onsi/ginkgo/ginkgo
RUN_GINKGO = ginkgo

default: bin

Expand Down Expand Up @@ -116,8 +116,7 @@ goget-tools:

.PHONY: goget-ginkgo
goget-ginkgo:
@echo "This is no longer used."
@echo "Ginkgo can be executed directly from this repository using command '$(RUN_GINKGO)'"
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest

.PHONY: test-coverage
test-coverage: ## Run unit tests and collect coverage
Expand Down
1 change: 1 addition & 0 deletions scripts/openshiftci-periodic-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ oc login -u developer -p password@123
oc whoami

# Integration tests
make goget-ginkgo || error=true
make test-integration || error=true
make test-integration-devfile || error=true
make test-cmd-login-logout || error=true
Expand Down
1 change: 1 addition & 0 deletions scripts/openshiftci-presubmit-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ else
make configure-installer-tests-cluster
fi
make bin
make goget-ginkgo
mkdir -p $GOPATH/bin
make goget-ginkgo
export PATH="$PATH:$(pwd):$GOPATH/bin"
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package tools

import (
_ "github.com/frapposelli/wwhrd"
_ "github.com/onsi/ginkgo/ginkgo"
_ "github.com/onsi/ginkgo/v2"
_ "github.com/securego/gosec/v2/cmd/gosec"
)

Expand Down

0 comments on commit a0fc119

Please sign in to comment.