Skip to content

[WIP] 🌱 cleanup/e2e-fixtures #3310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
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
Loading