Skip to content

OPRUN-4068: OTE: rewrite the upgrade incompatible operator test #427

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

Merged
merged 1 commit into from
Aug 13, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions openshift/.bingo/Variables.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
Expand All @@ -7,16 +7,28 @@ GO ?= $(shell which go)

# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for kustomize variable:
# For example for go-bindata variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(KUSTOMIZE)
# @echo "Running kustomize"
# @$(KUSTOMIZE) <flags/args..>
#command: $(GO_BINDATA)
# @echo "Running go-bindata"
# @$(GO_BINDATA) <flags/args..>
#
GO_BINDATA := $(GOBIN)/go-bindata-v3.1.2+incompatible
$(GO_BINDATA): $(BINGO_DIR)/go-bindata.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/go-bindata-v3.1.2+incompatible"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=go-bindata.mod -o=$(GOBIN)/go-bindata-v3.1.2+incompatible "github.com/go-bindata/go-bindata/go-bindata"

GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.1.6
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v2.1.6"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v2.1.6 "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"

KUSTOMIZE := $(GOBIN)/kustomize-v5.0.1
$(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
Expand Down
5 changes: 5 additions & 0 deletions openshift/.bingo/go-bindata.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.4

require github.com/go-bindata/go-bindata v3.1.2+incompatible // go-bindata
2 changes: 2 additions & 0 deletions openshift/.bingo/go-bindata.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
5 changes: 5 additions & 0 deletions openshift/.bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.4

require github.com/golangci/golangci-lint/v2 v2.1.6 // cmd/golangci-lint
952 changes: 952 additions & 0 deletions openshift/.bingo/golangci-lint.sum

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion openshift/.bingo/variables.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
Expand All @@ -8,6 +8,10 @@ if [ -z "$GOBIN" ]; then
fi


GO_BINDATA="${GOBIN}/go-bindata-v3.1.2+incompatible"

GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.1.6"

KUSTOMIZE="${GOBIN}/kustomize-v5.0.1"

YQ="${GOBIN}/yq-v4.34.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "[sig-olmv1] OLMv1 should pass a trivial sanity check",
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed",
"labels": {},
"resources": {
"isolation": {}
Expand All @@ -10,7 +10,7 @@
"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed",
"name": "[sig-olmv1] OLMv1 should pass a trivial sanity check",
"labels": {},
"resources": {
"isolation": {}
Expand All @@ -20,7 +20,7 @@
"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension",
"name": "[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 CRDs should be installed",
"labels": {},
"resources": {
"isolation": {}
Expand All @@ -30,7 +30,7 @@
"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension",
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should install a cluster extension",
"labels": {},
"resources": {
"isolation": {}
Expand All @@ -40,7 +40,7 @@
"environmentSelector": {}
},
{
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should block cluster upgrades if an incompatible operator is installed",
"name": "[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation should fail to install a non-existing cluster extension",
Copy link
Contributor

@camilamacedo86 camilamacedo86 Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot change the names
If we do that, we break component readiness
The name is stored in a database and used we need to ensure them over the time

We might could rename:https://github.com/openshift/operator-framework-operator-controller/tree/main/openshift/tests-extension#how-to-rename-a-test

But I would say at this stage, let's just keep the same names and tests to avoid problems with the Sippy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not changing the names, because the test was moved to a new file, it's changing the ordering. Look at the list overall.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I validate thank you a lot !!!

"labels": {},
"resources": {
"isolation": {}
Expand Down
21 changes: 19 additions & 2 deletions openshift/tests-extension/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Get the directory where this Makefile is, so we can use it below for including
# Include the same Bingo variables used by the project
DIR := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
include $(DIR)/../../.bingo/Variables.mk
# Use openshift's Bingo variables
include $(DIR)/../.bingo/Variables.mk

# Definitions for the extended tests

Expand Down Expand Up @@ -63,11 +64,27 @@ lint: $(GOLANGCI_LINT) #HELP Run golangci linter.
fix-lint: $(GOLANGCI_LINT) #HELP Fix lint issues
$(GOLANGCI_LINT) run --fix

# Bindata generation
.PHONY: bindata
bindata: $(GO_BINDATA)

bindata: pkg/bindata/operator/operator.go
pkg/bindata/operator/operator.go: $(shell find testdata/operator -type f)
mkdir -p $(@D)
$(GO_BINDATA) -pkg operator -o $@ -prefix "testdata/operator" testdata/operator/...
go fmt ./$(@D)/...

bindata: pkg/bindata/catalog/catalog.go
pkg/bindata/catalog/catalog.go: $(shell find testdata/catalog -type f)
mkdir -p $(@D)
$(GO_BINDATA) -pkg catalog -o $@ -prefix "testdata/catalog" testdata/catalog/...
go fmt ./$(@D)/...

# GO_COMPLIANCE_POLICY="exempt_all" must only be used for test related binaries.
# It prevents various FIPS compliance policies from being applied to this compilation.
# Do not set globally.
.PHONY: build
build: #HELP Build the extended tests binary
build: bindata #HELP Build the extended tests binary
@mkdir -p $(TOOLS_BIN_DIR)
GO_COMPLIANCE_POLICY="exempt_all" go build -ldflags "$(LDFLAGS)" -mod=vendor -o $(TOOLS_BIN_DIR)/olmv1-tests-ext ./cmd/...

Expand Down
5 changes: 3 additions & 2 deletions openshift/tests-extension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ module github/operator-framework-operator-controller/openshift/tests-extension
go 1.24.3

require (
github.com/blang/semver/v4 v4.0.0
github.com/onsi/ginkgo/v2 v2.23.3
github.com/onsi/gomega v1.37.0
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9
github.com/openshift/api v0.0.0-20250718204806-3333746edfbf
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee
github.com/operator-framework/operator-controller v1.3.0
github.com/spf13/cobra v1.9.1
k8s.io/api v0.33.2
k8s.io/apiextensions-apiserver v0.33.2
k8s.io/apimachinery v0.33.3
k8s.io/client-go v0.33.2
k8s.io/utils v0.0.0-20241210054802-24370beab758
sigs.k8s.io/controller-runtime v0.21.0
)

Expand Down Expand Up @@ -62,7 +64,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions openshift/tests-extension/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=
github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9 h1:4ZeSM80DVCb5WWB3Q/fyCI9jYXAl9bfrGnFvFONqzN4=
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250722101414-8083129ab8f9/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
github.com/openshift/api v0.0.0-20250718204806-3333746edfbf h1:NFtgSlz4oqI8CHOenkBK5Xq+hLJhe3c9fkyxMSysgIA=
github.com/openshift/api v0.0.0-20250718204806-3333746edfbf/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1 h1:VElrUno5AG2Zl6M+2pYPiXXPfNGpeb+0v95sl8AAczw=
github.com/openshift/api v0.0.0-20250808142411-c974eeafe3f1/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM=
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee h1:tOtrrxfDEW8hK3eEsHqxsXurq/D6LcINGfprkQC3hqY=
github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee/go.mod h1:zhRiYyNMk89llof2qEuGPWPD+joQPhCRUc2IK0SB510=
github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12 h1:AKx/w1qpS8We43bsRgf8Nll3CGlDHpr/WAXvuedTNZI=
Expand Down
Loading