Skip to content

Commit

Permalink
Run Ginkgo tests with parallelism and randomization
Browse files Browse the repository at this point in the history
Using parallelism and randomization for tests strengthen their robustness
  • Loading branch information
razo7 committed Feb 1, 2023
1 parent 8d8bd9a commit c2a404b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ test: test-no-verify verify-unchanged ## Generate and format code, run tests, ge

.PHONY: test-no-verify
test-no-verify: manifests generate go-verify fmt vet envtest ginkgo ## Generate and format code, and run tests
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(LOCALBIN))" $(GINKGO) -r --keep-going --require-suite --vv ./api/... ./controllers/... --coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(LOCALBIN))" $(GINKGO) -r --keep-going --randomize-all -p --require-suite --vv ./api/... ./controllers/... --coverprofile cover.out

##@ Bundle Creation Addition
## Some addition to bundle creation in the bundle
Expand Down
4 changes: 3 additions & 1 deletion hack/functest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ fi

# -r: If set, ginkgo finds and runs test suites under the current directory recursively.
# --keep-going: If set, failures from earlier test suites do not prevent later test suites from running.
# --randomize-all: If set, ginkgo will randomize all specs together. By default, ginkgo only randomizes the top level Describe, Context and When containers.
# -p: If set, ginkgo will run in parallel with an auto-detected number of nodes.
# --require-suite: If set, Ginkgo fails if there are ginkgo tests in a directory but no invocation of RunSpecs.
# --no-color: If set, suppress color output in default reporter.
# --vv: If set, emits with maximal verbosity - includes skipped and pending tests.
./bin/ginkgo/$1/ginkgo -r --keep-going --require-suite $NO_COLOR --vv ./test/e2e
./bin/ginkgo/$1/ginkgo -r --keep-going --randomize-all -p --require-suite $NO_COLOR --vv ./test/e2e

if [[ $? != 0 ]]; then
echo "E2e tests FAILED"
Expand Down

0 comments on commit c2a404b

Please sign in to comment.