Skip to content

Commit

Permalink
Added operator-sdk support to the e2e workflow
Browse files Browse the repository at this point in the history
Signed-off-by: jubittajohn <jujohn@redhat.com>

Refractored the plain bundle and registry bundle interactions; Updated the comments and README

Signed-off-by: jubittajohn <jujohn@redhat.com>

Added make target to install operator-sdk; Added make target to deploy a local registry server; Changed test to use the local registry server

Signed-off-by: jubittajohn <jujohn@redhat.com>
  • Loading branch information
jubittajohn committed Jul 27, 2023
1 parent 4e15888 commit 60dde4f
Show file tree
Hide file tree
Showing 14 changed files with 1,527 additions and 833 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: operator-framework-e2e
name: operator-developer-e2e

on:
workflow_dispatch:
pull_request:
push:
branches:
- operator-framework-e2e
- main

jobs:
e2e-kind:
operator-developer-e2e:
runs-on: ubuntu-latest
steps:

Expand All @@ -20,4 +20,4 @@ jobs:

- name: Run the operator framework e2e test
run: |
make operator-framework-e2e
make operator-developer-e2e
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ E2E_FLAGS ?= ""
test-e2e: $(GINKGO) ## Run the e2e tests
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress $(FOCUS) test/e2e

test-operator-framework-e2e: $(GINKGO) ## Run operator create, upgrade and delete tests
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress test/operator-e2e
test-operator-developer-e2e: $(GINKGO) ## Run operator create, upgrade and delete tests
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress test/operator-framework-e2e

ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
UNIT_TEST_DIRS=$(shell go list ./... | grep -v /test/)
Expand All @@ -108,8 +108,8 @@ test-unit: $(SETUP_ENVTEST) ## Run the unit tests
e2e: KIND_CLUSTER_NAME=operator-controller-e2e
e2e: run kind-load-test-artifacts test-e2e kind-cluster-cleanup ## Run e2e test suite on local kind cluster

operator-framework-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-framework e2e on local kind cluster
operator-framework-e2e: run opm test-operator-framework-e2e kind-cluster-cleanup
operator-developer-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-developer e2e on local kind cluster
operator-developer-e2e: run opm install-operator-sdk deploy-local-registry test-operator-developer-e2e stop-local-registry kind-cluster-cleanup

kind-load: $(KIND) ## Loads the currently constructed image onto the cluster
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)
Expand Down Expand Up @@ -147,6 +147,25 @@ OPM = $(shell which opm)
endif
endif

.PHONY: install-operator-sdk
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.30.0
export OS=$(shell go env GOOS)
export ARCH=$(shell go env GOARCH)
install-operator-sdk: ## Install operator-sdk
if [ ! -f ~/bin/operator-sdk ]; then \
curl -LO $(OPERATOR_SDK_DL_URL)/operator-sdk_${OS}_${ARCH} ; \
chmod +x operator-sdk_${OS}_${ARCH} ; \
mv operator-sdk_$(OS)_$(ARCH) /usr/local/bin/operator-sdk ; \
fi

.PHONY: deploy-local-registry
deploy-local-registry: ## Deploy local docker registry
docker run -d -p 5000:5000 --restart=always --name local-registry registry:2

.PHONY: stop-local-registry
stop-local-registry: ## Stop and remove local registry
docker container stop local-registry && docker container rm -v local-registry

##@ Build

export VERSION ?= $(shell git describe --tags --always --dirty)
Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/h2non/filetype v1.1.1 // indirect
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
github.com/imdario/mergo v0.3.13 // indirect
Expand All @@ -91,7 +93,10 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/operator-framework/api v0.17.3 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42 // indirect
github.com/otiai10/copy v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
Expand Down
255 changes: 245 additions & 10 deletions go.sum

Large diffs are not rendered by default.

53 changes: 0 additions & 53 deletions test/operator-e2e/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions test/operator-e2e/config/catalog_config.yaml

This file was deleted.

70 changes: 0 additions & 70 deletions test/operator-e2e/config/read_config.go

This file was deleted.

146 changes: 0 additions & 146 deletions test/operator-e2e/create_fbc.go

This file was deleted.

Loading

0 comments on commit 60dde4f

Please sign in to comment.