Skip to content

Commit dd41d0b

Browse files
committed
(e2e) Use custom built test catalog for e2e testing
closes #215 Signed-off-by: Anik <[email protected]>
1 parent 25cdc88 commit dd41d0b

15 files changed

+14812
-143
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ export GORELEASER_VERSION ?= v1.16.2
1111
export RUKPAK_VERSION=$(shell go list -mod=mod -m -f "{{.Version}}" github.com/operator-framework/rukpak)
1212
export WAIT_TIMEOUT ?= 60s
1313
IMG?=$(IMAGE_REPO):$(IMAGE_TAG)
14+
TESTDATA_DIR := testdata
1415

1516
OPERATOR_CONTROLLER_NAMESPACE ?= operator-controller-system
1617
KIND_CLUSTER_NAME ?= operator-controller
1718

19+
CONTAINER_RUNTIME ?= docker
20+
1821
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
1922
ifeq (,$(shell go env GOBIN))
2023
GOBIN=$(shell go env GOPATH)/bin
@@ -82,7 +85,7 @@ test-unit: envtest ## Run the unit tests
8285
eval $$($(ENVTEST) use -p env $(ENVTEST_VERSION)) && go test -tags $(GO_BUILD_TAGS) -count=1 -short $(UNIT_TEST_DIRS) -coverprofile cover.out
8386

8487
e2e: KIND_CLUSTER_NAME=operator-controller-e2e
85-
e2e: run test-e2e kind-cluster-cleanup ## Run e2e test suite on local kind cluster
88+
e2e: run kind-load-test-artifacts test-e2e kind-cluster-cleanup ## Run e2e test suite on local kind cluster
8689

8790
kind-load: kind ## Loads the currently constructed image onto the cluster
8891
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)
@@ -94,6 +97,12 @@ kind-cluster: kind kind-cluster-cleanup ## Standup a kind cluster
9497
kind-cluster-cleanup: kind ## Delete the kind cluster
9598
$(KIND) delete cluster --name ${KIND_CLUSTER_NAME}
9699

100+
kind-load-test-artifacts: kind ## Load the e2e testdata container images into a kind cluster
101+
$(CONTAINER_RUNTIME) build $(TESTDATA_DIR)/bundles/registry-v1/prometheus-operator.v0.47.0 -t localhost/testdata/bundles/registry-v1/prometheus-operator:v0.47.0
102+
$(CONTAINER_RUNTIME) build $(TESTDATA_DIR)/catalogs -f $(TESTDATA_DIR)/catalogs/test-catalog.Dockerfile -t localhost/testdata/catalogs/registryv1-catalog:e2e
103+
$(KIND) load docker-image localhost/testdata/bundles/registry-v1/prometheus-operator:v0.47.0 --name $(KIND_CLUSTER_NAME)
104+
$(KIND) load docker-image localhost/testdata/catalogs/registryv1-catalog:e2e --name $(KIND_CLUSTER_NAME)
105+
97106
##@ Build
98107

99108
BUILDCMD = sh -c 'mkdir -p $(BUILDBIN) && ${GORELEASER} build ${GORELEASER_ARGS} --single-target -o $(BUILDBIN)/manager'

test/e2e/install_test.go

Lines changed: 166 additions & 142 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM scratch
2+
COPY manifests /manifests
3+
COPY metadata /metadata

testdata/bundles/registry-v1/prometheus-operator.v0.47.0/manifests/alertmanagerconfigs.monitoring.coreos.com.crd.yaml

Lines changed: 1866 additions & 0 deletions
Large diffs are not rendered by default.

testdata/bundles/registry-v1/prometheus-operator.v0.47.0/manifests/alertmanagers.monitoring.coreos.com.crd.yaml

Lines changed: 3215 additions & 0 deletions
Large diffs are not rendered by default.

testdata/bundles/registry-v1/prometheus-operator.v0.47.0/manifests/podmonitors.monitoring.coreos.com.crd.yaml

Lines changed: 355 additions & 0 deletions
Large diffs are not rendered by default.

testdata/bundles/registry-v1/prometheus-operator.v0.47.0/manifests/probes.monitoring.coreos.com.crd.yaml

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.

testdata/bundles/registry-v1/prometheus-operator.v0.47.0/manifests/prometheuses.monitoring.coreos.com.crd.yaml

Lines changed: 4444 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)