Skip to content

Commit

Permalink
Remove deprecated integration tests
Browse files Browse the repository at this point in the history
The integration tests don't work anymore, because the test suite has
been removed upstream

Signed-off-by: Nicolas Bigler <[email protected]>
  • Loading branch information
TheBigLee committed Oct 23, 2024
1 parent f8ef892 commit 1745673
Show file tree
Hide file tree
Showing 14 changed files with 1,111 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
with:
report_paths: "**/e2e/report.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: e2e-report (${{ matrix.kind-node-version }}
check_name: e2e-report (${{ matrix.kind-node-version }})
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,13 @@ all: lint test build ## Invokes the lint, test & build targets
test: ## Run tests
go test -v ./... -coverprofile cover.out

# See https://storage.googleapis.com/kubebuilder-tools/ for list of supported K8s versions
#
# A note on 1.20.2:
# 1.20.2 is not (yet) supported, because starting the Kubernetes API controller with
# `--insecure-port` and `--insecure-bind-address` flags is now deprecated,
# but envtest was not updated accordingly.
#integration-test: export ENVTEST_K8S_VERSION = 1.20.2
integration-test: export ENVTEST_K8S_VERSION = 1.19.2
integration-test: export ENVTEST_K8S_VERSION = 1.28.2
integration-test: export KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT = $(INTEGRATION_TEST_DEBUG_OUTPUT)
integration-test: $(CROSSPLANE_CRDS) ## Run integration tests with envtest
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || \
curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/master/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; \
fetch_envtest_tools $(ENVTEST_ASSETS_DIR); \
setup_envtest_env $(ENVTEST_ASSETS_DIR); \
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest; \
setup-envtest use -p path 1.25.x!; \
source <(setup-envtest use -i -p env 1.25.x); \
cp $${KUBEBUILDER_ASSETS}/* ${TESTBIN_DIR}; \
go test -tags=integration -v ./... -coverprofile cover.out

.PHONY: build
Expand Down Expand Up @@ -102,7 +94,7 @@ $(BIN_FILENAME):

# TODO(mw): something with this target is off, $@ should be used instead of $*.yaml but I can't seem to make it work.
$(TESTDATA_CRD_DIR)/%.yaml: $(testbin_created)
curl -sSLo $@ https://raw.githubusercontent.com/crossplane/crossplane/$(CROSSPLANE_VERSION)/cluster/charts/crossplane/crds/$*.yaml
curl -sSLo $@ https://raw.githubusercontent.com/crossplane/crossplane/$(CROSSPLANE_VERSION)/cluster/crds/$*.yaml

###
### KIND
Expand Down
2 changes: 1 addition & 1 deletion Makefile.vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ E2E_REPO ?= local.dev/crossplane-service-broker/e2e
E2E_IMG = $(E2E_REPO):$(E2E_TAG)

TESTDATA_CRD_DIR = $(TESTDATA_DIR)/crds
CROSSPLANE_VERSION = v1.12.2
CROSSPLANE_VERSION = v1.15.3
CROSSPLANE_CRDS = $(addprefix $(TESTDATA_CRD_DIR)/, apiextensions.crossplane.io_compositeresourcedefinitions.yaml \
apiextensions.crossplane.io_compositions.yaml \
pkg.crossplane.io_configurationrevisions.yaml \
Expand Down
2 changes: 1 addition & 1 deletion e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test: setup kind-e2e-image ## Run the E2E tests
@$(bats) . $(bats_args)

kind-e2e-image: kind-setup ## Load the e2e container image onto e2e cluster
$(kind_bin) load docker-image --name $(KIND_CLUSTER) $(E2E_IMG)
$(KIND) load docker-image --name $(KIND_CLUSTER) $(E2E_IMG)

.PHONY: setup
setup: export KUBECONFIG = $(KIND_KUBECONFIG)
Expand Down
17 changes: 7 additions & 10 deletions e2e/kind.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
kind_marker := $(TESTBIN_DIR)/.kind-setup_complete

go_bin ?= $(PWD)/.work/bin
go_bin ?= $(PWD)/testdata/bin
$(go_bin):
@mkdir -p $@

kind_dir ?= $(PWD)/.kind
kind_bin = $(go_bin)/kind

# Prepare kind binary
$(kind_bin): export GOOS = $(shell go env GOOS)
$(kind_bin): export GOARCH = $(shell go env GOARCH)
$(kind_bin): export GOBIN = $(go_bin)
$(kind_bin): | $(go_bin)
$(KIND): export GOOS = $(shell go env GOOS)
$(KIND): export GOARCH = $(shell go env GOARCH)
$(KIND): export GOBIN = $(go_bin)
$(KIND): | $(go_bin)
go install sigs.k8s.io/kind@latest

.DEFAULT_TARGET: kind-setup
Expand All @@ -34,8 +31,8 @@ $(KIND): export KUBECONFIG = $(KIND_KUBECONFIG)
$(KIND): $(testbin_created)

$(KIND_KUBECONFIG): export KUBECONFIG = $(KIND_KUBECONFIG)
$(KIND_KUBECONFIG): $(kind_bin)
$(kind_bin) create cluster --name $(KIND_CLUSTER) --image kindest/node:$(KIND_NODE_VERSION)
$(KIND_KUBECONFIG): $(KIND)
$(KIND) create cluster --name $(KIND_CLUSTER) --image kindest/node:$(KIND_NODE_VERSION)
@kubectl version
@kubectl cluster-info

Expand Down
31 changes: 17 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
module github.com/vshn/crossplane-service-broker

go 1.23
go 1.23.0

toolchain go1.23.2

require (
code.cloudfoundry.org/lager v2.0.0+incompatible
github.com/crossplane/crossplane v1.12.3
github.com/crossplane/crossplane-runtime v1.12.1
github.com/crossplane/crossplane v1.15.3
github.com/crossplane/crossplane-runtime v1.16.0
github.com/go-logr/zapr v1.3.0
github.com/gorilla/mux v1.8.1
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-getter v1.7.6
github.com/pascaldekloe/jwt v1.12.0
github.com/pivotal-cf/brokerapi/v8 v8.2.3
github.com/prometheus/client_golang v1.20.5
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
k8s.io/apiextensions-apiserver v0.31.1
k8s.io/apimachinery v0.32.0-alpha.2
k8s.io/client-go v0.31.1
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
sigs.k8s.io/controller-runtime v0.19.0
sigs.k8s.io/yaml v1.4.0
)

require (
Expand All @@ -38,11 +41,12 @@ require (
cloud.google.com/go/storage v1.36.0 // indirect
connectrpc.com/connect v1.17.0 // indirect
connectrpc.com/otelconnect v0.7.1 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.8 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/aws/aws-sdk-go v1.33.0 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bufbuild/buf v1.45.0 // indirect
Expand Down Expand Up @@ -98,9 +102,8 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/go-getter v1.6.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jdx/go-netrc v1.0.0 // indirect
Expand All @@ -114,7 +117,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
Expand Down Expand Up @@ -152,15 +155,15 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/tetratelabs/wazero v1.8.1 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vbatts/tar-split v0.11.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.lsp.dev/jsonrpc2 v0.10.0 // indirect
go.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 // indirect
go.lsp.dev/protocol v0.12.0 // indirect
go.lsp.dev/uri v0.3.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect
Expand All @@ -183,8 +186,8 @@ require (
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.26.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/api v0.155.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/grpc v1.67.1 // indirect
Expand All @@ -193,7 +196,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/code-generator v0.31.1 // indirect
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
Expand All @@ -202,5 +204,6 @@ require (
sigs.k8s.io/controller-tools v0.16.4 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/crossplane/crossplane-runtime => github.com/crossplane/crossplane-runtime v1.15.1
Loading

0 comments on commit 1745673

Please sign in to comment.