Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 18 additions & 13 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@ jobs:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.vars.outputs.sha }}
UPDATE_FIXTURES: ${{ steps.fixtures.outputs.UPDATE_FIXTURES }}
steps:
# checkout code and setup go
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
# build binaries and image for e2e test (includes experimental features)
- name: Build controller image
run: make e2e-build
- name: Save image
run: docker save quay.io/operator-framework/olm:local -o olm-image.tar
- name: Upload Docker image as artifact
- name: Build OLM Image
run: |
make e2e-build
docker save quay.io/operator-framework/olm:local | gzip > olm-image.tar.gz
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: olm-image.tar
path: olm-image.tar
name: docker-images
path: "*.tar.gz"

# Run e2e tests in parallel jobs
# Take olm image from the previous stage
Expand All @@ -54,13 +55,17 @@ jobs:
with:
go-version-file: "go.mod"

# load the olm image
- name: Load OLM Docker image
# load images into kind
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: olm-image.tar
path: .
- run: docker load < olm-image.tar
name: docker-images
path: images/
- name: Load Docker images
run: |
for image in images/*.tar.gz; do
docker load -i $image
done

# set e2e environment variables
# Set ginkgo output and parallelism
Expand All @@ -87,7 +92,7 @@ jobs:
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
make kind-create deploy;
make kind-create image-registry build-and-load-e2e-fixture-images deploy;
done

# run non-flakes if matrix-id is not 'flakes'
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: fixtures
on:
push:
branches:
- master
jobs:
rebuild:
if: ${{ needs.build.outputs.UPDATE_FIXTURES == 'true' && success() }}
needs: e2e-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Docker Login
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: docker-images
path: images/
- name: Load Docker images
run: |
for image in images/*.tar.gz; do
docker load -i $image
done
- name: Push fixture images
run: scripts/e2e_test_fixtures.sh --push --skip-build
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,25 @@ kind-create: kind-clean #HELP Create a new kind cluster $KIND_CLUSTER_NAME (defa
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --image $(KIND_CLUSTER_IMAGE) $(KIND_CREATE_OPTS)
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)

.PHONY: image-registry
E2E_REGISTRY_NAME := docker-registry
E2E_REGISTRY_NAMESPACE := olm-e2e
export REGISTRY_ROOT := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000
export CATALOG_IMG := $(REGISTRY_ROOT)/test-catalog:e2e
image-registry: ## Setup in-cluster image registry
./scripts/image_registry.sh "$(E2E_REGISTRY_NAMESPACE)" "$(E2E_REGISTRY_NAME)"

.PHONY: build-and-load-e2e-fixture-images
build-and-load-e2e-fixture-images: # Build e2e fixture images and either kind-load or push them to an on-cluster registry
# push the test-catalog to an on-cluster registry
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v1" "indexv1" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/busybox-dependencies-index:1.0.0-with-ListBundles-method-${OPERATOR_REGISTRY_VERSION}"
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v2" "indexv2" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/busybox-dependencies-index:2.0.0-with-ListBundles-method-${OPERATOR_REGISTRY_VERSION}"
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v2" "test-catalog" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/test-catalog:e2e"

.PHONY: deploy
OLM_IMAGE := quay.io/operator-framework/olm:local
deploy: $(KIND) $(HELM) #HELP Deploy OLM to kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) using $OLM_IMAGE (default: quay.io/operator-framework/olm:local)
$(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME); \
$(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME)
$(HELM) upgrade --install olm deploy/chart \
--set debug=true \
--set olm.image.ref=$(OLM_IMAGE) \
Expand Down Expand Up @@ -247,12 +262,11 @@ E2E_TIMEOUT ?= 90m
E2E_TEST_NS ?= operators
E2E_INSTALL_NS ?= operator-lifecycle-manager
E2E_CATALOG_NS ?= $(E2E_INSTALL_NS)
E2E_FLAKE_ATTEMPTS ?= 1
Comment thread
m1kola marked this conversation as resolved.
GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events --flake-attempts=$(E2E_FLAKE_ATTEMPTS) $(if $(E2E_SEED),-seed '$(E2E_SEED)') $(if $(TEST),-focus '$(TEST)',) $(if $(SKIP), -skip '$(SKIP)')
GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events $(if $(E2E_FLAKE_ATTEMPTS),-flake-attempts=$(E2E_FLAKE_ATTEMPTS) ) $(if $(E2E_SEED),-seed '$(E2E_SEED)' ) $(if $(TEST),-focus '$(TEST)', ) $(if $(SKIP), -skip '$(SKIP)')

.PHONY: e2e
e2e: #HELP Run e2e tests against a cluster running OLM (params: $E2E_TEST_NS (operator), $E2E_INSTALL_NS (operator-lifecycle-manager), $E2E_CATALOG_NS (operator-lifecycle-manager), $E2E_TIMEOUT (90m), $E2E_FLAKE_ATTEMPTS (1), $TEST(undefined))
$(GO_TEST_ENV) $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(E2E_OPTS)
$(GO_TEST_ENV) $(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) -opmVersion=$(OPERATOR_REGISTRY_VERSION) $(E2E_OPTS)

.PHONY: e2e-local
e2e-local: e2e-build kind-create deploy e2e
Expand Down
19 changes: 19 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ require (

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.3 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/akrylysov/pogreb v0.10.2 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -89,6 +92,9 @@ require (
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.11.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
Expand All @@ -106,34 +112,44 @@ require (
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/joelanford/ignore v0.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tidwall/btree v1.7.0 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
Expand Down Expand Up @@ -165,10 +181,13 @@ require (
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cli-runtime v0.30.0 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kms v0.30.1 // indirect
k8s.io/kubectl v0.30.0 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading