Skip to content

Commit b80f176

Browse files
author
Joshua Reed
committed
Moved tests back out of test dir. Wasn't quite do-able.
1 parent ebde962 commit b80f176

26 files changed

+49
-1322
lines changed

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ run:
3333
skip-dirs:
3434
- pkg/mocks
3535
- test
36+
37+
issues:
38+
# Excluding configuration per-path, per-linter, per-text and per-source
39+
exclude-rules:
40+
# Exclude some linters from running on tests files.
41+
- path: _test\.go
42+
linters:
43+
- dupl
44+
- gosec

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RELEASE_DIR ?= out
2323
export ACK_GINKGO_DEPRECATIONS := 1.16.5
2424
export ACK_GINKGO_RC=true
2525

26-
export PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
26+
PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
2727
export PATH := $(PROJECT_DIR)/bin:$(PATH)
2828

2929
all: build
@@ -177,10 +177,9 @@ export KUBEBUILDER_ASSETS=$(PROJECT_DIR)/bin
177177

178178
.PHONY: test
179179
test: generate-mocks lint bin/ginkgo bin/kubectl bin/kube-apiserver bin/etcd ## Run tests. At the moment this is only unit tests.
180-
@./hack/testing_ginkgo_recover_statements.sh --add # Add ginkgo.GinkgoRecover() statements to controllers.
181180
@# The following is a slightly funky way to make sure the ginkgo statements are removed regardless the test results.
182-
@cd ./test/unit && ginkgo_v2 -v ./... -coverprofile cover.out; EXIT_STATUS=$$?;\
183-
cd ../../ && ./hack/testing_ginkgo_recover_statements.sh --remove; exit $$EXIT_STATUS
181+
@ginkgo_v2 --cover -coverprofile cover.out --covermode=atomic -v ./api/... ./controllers/... ./pkg/...; EXIT_STATUS=$$?;\
182+
./hack/testing_ginkgo_recover_statements.sh --remove; exit $$EXIT_STATUS
184183

185184
.PHONY: generate-mocks
186185
generate-mocks: bin/mockgen generate-deepcopy pkg/mocks/mock_client.go $(shell find ./pkg/mocks -type f -name "mock*.go") ## Generate mocks needed for testing. Primarily mocks of the cloud package.
File renamed without changes.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/onsi/ginkgo/v2 v2.1.4
1111
github.com/onsi/gomega v1.19.0
1212
github.com/pkg/errors v0.9.1
13+
github.com/smallfish/simpleyaml v0.1.0
1314
github.com/spf13/pflag v1.0.5
1415
gopkg.in/ini.v1 v1.63.2
1516
k8s.io/api v0.23.0

0 commit comments

Comments
 (0)