Skip to content

Commit 9b3a1cb

Browse files
authored
Remove non-implemented Ginkgo BDD test (#247)
* Remove suite_test.go with Ginkgo BDD skeleton code. This file was auto-generated by kubebuilder, but no tests were added as we are relying on integration tests over BDD. Also, Upgrade golang.org/x/time to the latest version. * Remove unnecessary declaration * Remove envtest assests and config required for Ginkgo tests
1 parent 0734c08 commit 9b3a1cb

File tree

4 files changed

+8
-105
lines changed

4 files changed

+8
-105
lines changed

Makefile

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Silence update recommendations for Ginkgo
2-
export ACK_GINKGO_DEPRECATIONS:=1.16.5
3-
41
GIT_COMMIT:=$(shell git describe --dirty --always)
52
GIT_TAG:=$(shell git describe --dirty --always --tags)
63
PKG:=github.com/aws/aws-cloud-map-mcs-controller-for-k8s/pkg/version
@@ -68,20 +65,10 @@ lint: golangci-lint ## Run linter
6865
goimports: goimports-bin ## run goimports updating files in place
6966
$(GOIMPORTS) -w .
7067

71-
# Run tests
72-
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
73-
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
74-
7568
.PHONY: test
76-
test: manifests generate generate-mocks fmt vet test-setup goimports lint ## Run tests
77-
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) go test ./... -coverprofile cover.out -covermode=atomic
78-
79-
test-setup: setup-envtest ## Ensure test environment has been downloaded
80-
ifneq ($(shell test -d $(ENVTEST_ASSETS_DIR); echo $$?), 0)
81-
@echo Setting up K8s test environment...
82-
mkdir -p ${ENVTEST_ASSETS_DIR}
83-
$(ENVTEST) use 1.24.x --bin-dir $(ENVTEST_ASSETS_DIR)
84-
endif
69+
test: manifests generate generate-mocks fmt vet goimports lint ## Run tests
70+
@echo Testing...
71+
go test ./... -coverprofile=cover.out -covermode=atomic
8572

8673
kind-integration-suite: ## Provision and run integration tests with cleanup
8774
make kind-integration-setup && \
@@ -133,8 +120,7 @@ docker-push: ## Push docker image with the manager.
133120
clean:
134121
@echo Cleaning...
135122
go clean
136-
if test -d $(ENVTEST_ASSETS_DIR) ; then chmod -R +w $(ENVTEST_ASSETS_DIR) ; fi
137-
rm -rf $(MOCKS_DESTINATION)/ bin/ $(ENVTEST_ASSETS_DIR)/ cover.out
123+
rm -rf $(MOCKS_DESTINATION)/ bin/ cover.out
138124

139125
##@ Deployment
140126

@@ -172,10 +158,6 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
172158
kustomize: ## Download kustomize locally if necessary.
173159
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
174160

175-
ENVTEST = $(shell pwd)/bin/setup-envtest
176-
setup-envtest: ## Download setup-envtest
177-
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
178-
179161
MOCKGEN = $(shell pwd)/bin/mockgen
180162
mockgen: ## Download mockgen
181163
$(call go-get-tool,$(MOCKGEN),github.com/golang/mock/[email protected])

go.mod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ require (
99
github.com/go-logr/logr v1.2.3
1010
github.com/golang/mock v1.6.0
1111
github.com/google/go-cmp v0.5.9
12-
github.com/onsi/ginkgo v1.16.5
13-
github.com/onsi/gomega v1.20.2
1412
github.com/pkg/errors v0.9.1
1513
github.com/stretchr/testify v1.8.1
16-
golang.org/x/time v0.1.0
14+
golang.org/x/time v0.2.0
1715
k8s.io/api v0.24.3
1816
k8s.io/apimachinery v0.24.3
1917
k8s.io/client-go v0.24.2
@@ -65,7 +63,7 @@ require (
6563
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6664
github.com/modern-go/reflect2 v1.0.2 // indirect
6765
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
68-
github.com/nxadm/tail v1.4.8 // indirect
66+
github.com/onsi/gomega v1.20.2 // indirect
6967
github.com/pmezard/go-difflib v1.0.0 // indirect
7068
github.com/prometheus/client_golang v1.12.1 // indirect
7169
github.com/prometheus/client_model v0.2.0 // indirect
@@ -85,7 +83,6 @@ require (
8583
google.golang.org/appengine v1.6.7 // indirect
8684
google.golang.org/protobuf v1.28.0 // indirect
8785
gopkg.in/inf.v0 v0.9.1 // indirect
88-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
8986
gopkg.in/yaml.v2 v2.4.0 // indirect
9087
gopkg.in/yaml.v3 v3.0.1 // indirect
9188
k8s.io/apiextensions-apiserver v0.24.2 // indirect

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042
406406
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
407407
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
408408
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
409-
github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=
410409
github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
411410
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
412411
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
@@ -775,8 +774,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb
775774
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
776775
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
777776
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
778-
golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
779-
golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
777+
golang.org/x/time v0.2.0 h1:52I/1L54xyEQAYdtcSuxtiT84KGYTBGXwayxmIpNJhE=
778+
golang.org/x/time v0.2.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
780779
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
781780
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
782781
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

pkg/controllers/multicluster/suite_test.go

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

0 commit comments

Comments
 (0)