Skip to content

Commit 5f98c35

Browse files
Combine Unit-Tests
1 parent 2133355 commit 5f98c35

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

.github/workflows/catalogd-unit.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ verify-crd-compatibility: $(CRD_DIFF) manifests
137137
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" ${CRD_DIFF_UPDATED_SOURCE}
138138

139139
.PHONY: test
140-
test: manifests generate fmt vet test-unit test-e2e #HELP Run all tests.
140+
test: manifests generate generate-catalogd fmt vet test-unit test-e2e #HELP Run all tests.
141141

142142
.PHONY: e2e
143143
e2e: #EXHELP Run the e2e tests.
@@ -158,7 +158,7 @@ test-ext-dev-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension creat
158158
go test -count=1 -v ./test/extension-developer-e2e/...
159159

160160
ENVTEST_VERSION := $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
161-
UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/)
161+
UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/ | grep -v catalogd/test/e2e | grep -v catalogd/test/upgrade)
162162
COVERAGE_UNIT_DIR := $(ROOT_DIR)/coverage/unit
163163

164164
.PHONY: envtest-k8s-bins #HELP Uses setup-envtest to download and install the binaries required to run ENVTEST-test based locally at the project/bin directory.

catalogd/Makefile

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ export IMAGE_TAG
1515

1616
IMAGE := $(IMAGE_REPO):$(IMAGE_TAG)
1717

18-
# By default setup-envtest will write to $XDG_DATA_HOME, or $HOME/.local/share if that is not defined.
19-
# If $HOME is not set, we need to specify a binary directory to prevent an error in setup-envtest.
20-
# Useful for some CI/CD environments that set neither $XDG_DATA_HOME nor $HOME.
21-
SETUP_ENVTEST_BIN_DIR_OVERRIDE=
22-
ifeq ($(shell [[ $$HOME == "" || $$HOME == "/" ]] && [[ $$XDG_DATA_HOME == "" ]] && echo true ), true)
23-
SETUP_ENVTEST_BIN_DIR_OVERRIDE += --bin-dir /tmp/envtest-binaries
24-
endif
25-
2618
ifneq (, $(shell command -v docker 2>/dev/null))
2719
CONTAINER_RUNTIME := docker
2820
else ifneq (, $(shell command -v podman 2>/dev/null))
@@ -87,15 +79,6 @@ bingo-upgrade: $(BINGO) #EXHELP Upgrade tools
8779
$(BINGO) get "$$pkg@latest"; \
8880
done
8981

90-
.PHONY: test-unit
91-
UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/e2e | grep -v /test/upgrade)
92-
test-unit: generate $(SETUP_ENVTEST) ## Run tests.
93-
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_SERVER_VERSION) $(SETUP_ENVTEST_BIN_DIR_OVERRIDE)) && \
94-
go test \
95-
-tags '$(GO_BUILD_TAGS)' \
96-
-coverprofile cover.out \
97-
$(UNIT_TEST_DIRS)
98-
9982
FOCUS := $(if $(TEST),-v -focus "$(TEST)")
10083
ifeq ($(origin E2E_FLAGS), undefined)
10184
E2E_FLAGS :=

0 commit comments

Comments
 (0)