Skip to content

normalize unit test targets across repos. add skip/target test args #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ endif
REPO = github.com/operator-framework/api
BUILD_PATH = $(REPO)/cmd/operator-verify
PKGS = $(shell go list ./... | grep -v /vendor/)
SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),)
SPECIFIC_SKIP_UNIT_TEST := $(if $(SKIP),-skip $(SKIP),)

.PHONY: help
help: ## Show this help screen
Expand Down Expand Up @@ -76,13 +78,15 @@ manifests: yq controller-gen ## Generate manifests e.g. CRD, RBAC etc
$(Q)go generate ./crds/...

# Static tests.
.PHONY: test test-unit verify
.PHONY: test test-unit verify unit

test: test-unit ## Run the tests

unit: test-unit ## Run the tests

TEST_PKGS:=$(shell go list ./...)
test-unit: ## Run the unit tests
$(Q)go test -count=1 -short ${TEST_PKGS}
$(Q)go test -coverprofile=coverage.out -count=1 ${SPECIFIC_UNIT_TEST} ${SPECIFIC_SKIP_UNIT_TEST} ${TEST_PKGS}

verify: manifests generate format tidy
git diff --exit-code
Expand Down Expand Up @@ -132,4 +136,4 @@ $(KIND): $(LOCALBIN)
.PHONY: kind-cluster
kind-cluster: kind ## Create a kind cluster
$(KIND) create cluster --name olmv0 --image $(KIND_CLUSTER_IMAGE)
$(KIND) export kubeconfig --name olmv0
$(KIND) export kubeconfig --name olmv0
Loading