Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ad199f1
API Call Alerts (#2139)
dtfranz Aug 13, 2025
69cfbe2
:seedling: Bump actions/checkout from 4 to 5 (#2146)
dependabot[bot] Aug 13, 2025
b9b5a7e
:seedling: Bump charset-normalizer from 3.4.2 to 3.4.3 (#2147)
dependabot[bot] Aug 13, 2025
3ad6225
Internalize test pkgs (#2148)
dtfranz Aug 13, 2025
e7cf7a6
Merge branch 'main' into synchronize
Aug 14, 2025
9543b05
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
18d66d3
UPSTREAM: <carry>: Fix catalogd.Dockerfile to use new paths
tmshort Feb 26, 2025
0487e9d
UPSTREAM: <carry>: Update DOWNSTREAM_OWNERS_ALIASES
tmshort Mar 6, 2025
4f657ea
UPSTREAM: <carry>: Add openshift node selector annotation
oceanc80 Mar 26, 2025
4ac0d9d
UPSTREAM: <carry>: Add caalogd-cas-dir option to op-con
tmshort Apr 15, 2025
10bff94
UPSTREAM: <carry>: set the SElinux type
jianzhangbjz Apr 27, 2025
ccf1b58
UPSTREAM: <carry>: Add initial stack to run tests to validate the cat…
camilamacedo86 Apr 17, 2025
ea163b8
UPSTREAM: <carry>: Add vendor files for the catalog-sync tests
camilamacedo86 Apr 17, 2025
c71a4cd
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
fd03133
UPSTREAM: <carry>: revert "Bump catalog versions to 4.19"
tmshort May 15, 2025
e4ec2b2
UPSTREAM: <carry>: Update HOWTO-origin-tests
tmshort May 14, 2025
f111714
UPSTREAM: <carry>: [DefaultCatalogTests]: Allow to pass auth path for…
camilamacedo86 May 16, 2025
ba69665
UPSTREAM: <carry>: fix: set NoLchown=true to allow image unpack on OCPci
camilamacedo86 May 19, 2025
3d80555
UPSTREAM: <carry>: [DefaultCatalogTests]: Moving parse of ENVVAR to t…
camilamacedo86 May 17, 2025
68ee5de
UPSTREAM: <carry>: [Default Catalog]: Create tmp dir to extract layer…
camilamacedo86 May 20, 2025
ce11eb6
UPSTREAM: <carry>: [Default Catalog](cleanp) Remove hack directory wh…
camilamacedo86 May 19, 2025
662b257
UPSTREAM: <carry>: Change code implementation to extract layers in OC…
camilamacedo86 May 21, 2025
0c8ff5c
UPSTREAM: <carry>: Add vendor files for change in the extract code im…
camilamacedo86 May 21, 2025
7539a9f
UPSTREAM: <carry>: [Default Catalog Tests]: Final cleanups and enhanc…
camilamacedo86 May 22, 2025
9d4c8f2
UPSTREAM: <carry>: SELinux type for operator-controller
jianzhangbjz May 22, 2025
426f544
UPSTREAM: <carry>: Bump catalog versions to 4.19
tmshort Apr 24, 2025
5f3cb10
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 28, 2025
f7e8c08
UPSTREAM: <carry>: [Default Catalog Consistency Test]: fix junit outp…
camilamacedo86 Jun 2, 2025
92df2e3
UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add chec…
camilamacedo86 May 29, 2025
4f6d19c
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Enable Catalog…
camilamacedo86 Jun 4, 2025
5b1cb09
UPSTREAM: <carry>: [Default Catalog Consistency Test]: Rename Tests s…
camilamacedo86 Jun 4, 2025
6b941f5
UPSTREAM: <carry>: Updating ose-olm-operator-controller-container ima…
Jun 18, 2025
29f4924
UPSTREAM: <carry>: Updating ose-olm-catalogd-container image to be co…
Jun 18, 2025
dffa934
UPSTREAM: <carry>: Update e2e registry to use 1.24/4.20
tmshort Jun 30, 2025
32eeb4e
UPSTREAM: <carry>: [Catalog Default Tests]: Upgrade go version to 1.2…
camilamacedo86 Jul 1, 2025
e1ccf2b
UPSTREAM: <carry>: Add structure to allow move the orgin tests using OTE
camilamacedo86 Jun 13, 2025
5999a55
UPSTREAM: <carry>: Add support for experimental manifests
tmshort Jul 2, 2025
9e03f37
UPSTREAM: <carry>: [OTE] - chore: follow up #383 – remove unreachable…
camilamacedo86 Jul 10, 2025
3bb9781
UPSTREAM: <carry>: Remove build of test image registry
tmshort Jul 9, 2025
50e670e
UPSTREAM: <carry>: Add test-experimental-e2e target to openshift Make…
tmshort Jul 15, 2025
d12f8a4
UPSTREAM: <carry>: [OTE]: Add binary in the operator controller image…
camilamacedo86 Jul 11, 2025
dd9a9a9
UPSTREAM: <carry>: Fix experimental manifest copying
tmshort Jul 17, 2025
38614b0
UPSTREAM: <carry>: Update manifest generation for upstream rbac/webhooks
tmshort Jul 17, 2025
d6216b1
UPSTREAM: <carry>: [OTE] - Add tracking mechanism
camilamacedo86 Jul 17, 2025
95985a3
UPSTREAM: <carry>: Update OTE dep to get fix
camilamacedo86 Jul 22, 2025
5b30ba7
UPSTREAM: <carry>: [OTE] Add Readme
camilamacedo86 Jul 24, 2025
175d4c0
UPSTREAM: <carry>: set GIT_COMMIT env from SOURCE_GIT_COMMIT in Docke…
rashmigottipati Jun 6, 2025
0141d69
UPSTREAM: <carry>: add openshift specific build target to pass commit…
ankitathomas Jun 11, 2025
6c8bbf2
UPSTREAM: <carry>: add source commit into binaries when linking
bentito Jul 9, 2025
6eb6403
UPSTREAM: <carry>: OTE add first test from openshift/origin olmv1.go
camilamacedo86 Jul 19, 2025
dd5e610
UPSTREAM: <carry>: Migrate tasks from openshift/origin olm v1.go file…
camilamacedo86 Jul 31, 2025
e8ea00d
UPSTREAM: <carry>: OTE - How to test locally with OCP instances
camilamacedo86 Aug 6, 2025
db6edf0
UPSTREAM: <carry>: [OTE] Refac: refac helper and olmv1 test to create…
camilamacedo86 Aug 8, 2025
6e6dcc5
UPSTREAM: <carry>: [OTE] add webhook tests
camilamacedo86 Jul 31, 2025
762b006
UPSTREAM: <carry>: OTE: rewrite the upgrade incompatible operator test
tmshort Aug 11, 2025
2e46a89
UPSTREAM: <drop>: go mod vendor
Aug 14, 2025
e156f09
UPSTREAM: <drop>: remove upstream GitHub configuration
Aug 14, 2025
0cee284
UPSTREAM: <drop>: configure the commit-checker
Aug 14, 2025
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ extension-developer-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) #EXHELP Run extension crea
test/extension-developer-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) ${LOCAL_REGISTRY_HOST} ${CLUSTER_REGISTRY_HOST}
go test -count=1 -v ./test/extension-developer-e2e/...

UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/)
UNIT_TEST_DIRS := $(shell go list ./... | grep -vE "/test/|/testutils")
COVERAGE_UNIT_DIR := $(ROOT_DIR)/coverage/unit

.PHONY: envtest-k8s-bins #HELP Uses setup-envtest to download and install the binaries required to run ENVTEST-test based locally at the project/bin directory.
Expand Down
2 changes: 1 addition & 1 deletion commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: 3d6a33b60dab6aedec2b676eba3a7631d3961340
expectedMergeBase: 3ad622560d7872e336943a22b8e70923d2dc9c07
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
12 changes: 12 additions & 0 deletions config/overlays/prometheus/prometheus_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,15 @@ spec:
keep_firing_for: 1d
annotations:
description: "catalogd using high cpu resources for 5 minutes: {{ $value | printf \"%.2f\" }}%"
- alert: operator-controller-api-call-rate
expr: sum(rate(rest_client_requests_total{job=~"operator-controller-service"}[5m])) > 10
for: 5m
keep_firing_for: 1d
annotations:
description: "operator-controller making excessive API calls for 5 minutes: {{ $value | printf \"%.2f\" }}/sec"
- alert: catalogd-api-call-rate
expr: sum(rate(rest_client_requests_total{job=~"catalogd-service"}[5m])) > 5
for: 5m
keep_firing_for: 1d
annotations:
description: "catalogd making excessive API calls for 5 minutes: {{ $value | printf \"%.2f\" }}/sec"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package testutils

import (
"context"
Expand Down
54 changes: 32 additions & 22 deletions test/utils/summary.go → internal/shared/util/testutils/summary.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package testutils

import (
"context"
Expand Down Expand Up @@ -42,14 +42,16 @@ type xychart struct {
}

type githubSummary struct {
client api.Client
Pods []string
client api.Client
Pods []string
alertsFiring bool
}

func NewSummary(c api.Client, pods ...string) githubSummary {
return githubSummary{
client: c,
Pods: pods,
client: c,
Pods: pods,
alertsFiring: false,
}
}

Expand All @@ -60,7 +62,7 @@ func NewSummary(c api.Client, pods ...string) githubSummary {
// yLabel - Label of the Y axis i.e. "KB/s", "MB", etc.
// scaler - Constant by which to scale the results. For instance, cpu usage is more human-readable
// as "mCPU" vs "CPU", so we scale the results by a factor of 1,000.
func (s githubSummary) PerformanceQuery(title, pod, query string, yLabel string, scaler float64) (string, error) {
func (s *githubSummary) PerformanceQuery(title, pod, query, yLabel string, scaler float64) (string, error) {
v1api := v1.NewAPI(s.client)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
Expand Down Expand Up @@ -90,8 +92,9 @@ func (s githubSummary) PerformanceQuery(title, pod, query string, yLabel string,
formattedData := make([]string, 0)
// matrix does not allow [] access, so we just do one iteration for the single result
for _, metric := range matrix {
if len(metric.Values) < 1 {
return "", fmt.Errorf("expected at least one data point; got: %d", len(metric.Values))
if len(metric.Values) < 2 {
// A graph with one data point means something with the collection was wrong
return "", fmt.Errorf("expected at least two data points; got: %d", len(metric.Values))
}
for _, sample := range metric.Values {
floatSample := float64(sample.Value) * scaler
Expand All @@ -115,7 +118,7 @@ func (s githubSummary) PerformanceQuery(title, pod, query string, yLabel string,

// Alerts queries the prometheus server for alerts and generates markdown output for anything found.
// If no alerts are found, the alerts section will contain only "None." in the final output.
func (s githubSummary) Alerts() (string, error) {
func (s *githubSummary) Alerts() (string, error) {
v1api := v1.NewAPI(s.client)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
Expand All @@ -136,6 +139,7 @@ func (s githubSummary) Alerts() (string, error) {
switch a.State {
case v1.AlertStateFiring:
firingAlerts = append(firingAlerts, aConv)
s.alertsFiring = true
case v1.AlertStatePending:
pendingAlerts = append(pendingAlerts, aConv)
// Ignore AlertStateInactive; the alerts endpoint doesn't return them
Expand Down Expand Up @@ -172,28 +176,34 @@ func executeTemplate(templateFile string, obj any) (string, error) {
// The markdown is template-driven; the summary methods are called from within the
// template. This allows us to add or change queries (hopefully) without needing to
// touch code. The summary will be output to a file supplied by the env target.
func PrintSummary(envTarget string) error {
func PrintSummary(path string) error {
if path == "" {
fmt.Printf("No summary output path specified; skipping")
return nil
}

client, err := api.NewClient(api.Config{
Address: defaultPromUrl,
})
if err != nil {
fmt.Printf("Error creating prometheus client: %v\n", err)
os.Exit(1)
fmt.Printf("warning: failed to initialize promQL client: %v", err)
return nil
}

summary := NewSummary(client, "operator-controller", "catalogd")
summaryMarkdown, err := executeTemplate(summaryTemplate, summary)
summaryMarkdown, err := executeTemplate(summaryTemplate, &summary)
if err != nil {
return err
fmt.Printf("warning: failed to generate e2e test summary: %v", err)
return nil
}
if path := os.Getenv(envTarget); path != "" {
err = os.WriteFile(path, []byte(summaryMarkdown), 0o600)
if err != nil {
return err
}
fmt.Printf("Test summary output to %s successful\n", envTarget)
} else {
fmt.Printf("No summary output specified; skipping")
err = os.WriteFile(path, []byte(summaryMarkdown), 0o600)
if err != nil {
fmt.Printf("warning: failed to write e2e test summary output to %s: %v", path, err)
return nil
}
fmt.Printf("Test summary output to %s successful\n", path)
if summary.alertsFiring {
return fmt.Errorf("performance alerts encountered during test run; please check e2e test summary for details")
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

#### CPU Usage
{{$.PerformanceQuery "CPU Usage" $pod `rate(container_cpu_usage_seconds_total{pod=~"%s.*",container="manager"}[5m])[5m:]` "mCPU" 1000}}

#### API Queries Total
{{$.PerformanceQuery "API Queries Total" $pod `sum(rest_client_requests_total{job=~"%s.*"})[5m:]` "# queries" 1}}

#### API Query Rate
{{$.PerformanceQuery "API Queries/sec" $pod `sum(rate(rest_client_requests_total{job=~"%s.*"}[5m]))[5m:]` "per sec" 1}}

{{end}}
{{- end}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package testutils

import (
"os/exec"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Babel==2.17.0
beautifulsoup4==4.13.4
certifi==2025.8.3
charset-normalizer==3.4.2
charset-normalizer==3.4.3
click==8.1.8
colorama==0.4.6
cssselect==1.3.0
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/cluster_extension_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

const (
Expand Down
17 changes: 12 additions & 5 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
utils "github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

var (
Expand All @@ -25,7 +25,7 @@ var (
)

const (
testSummaryOutputEnvVar = "GITHUB_STEP_SUMMARY"
testSummaryOutputEnvVar = "E2E_SUMMARY_OUTPUT"
testCatalogRefEnvVar = "CATALOG_IMG"
testCatalogName = "test-catalog"
latestImageTag = "latest"
Expand All @@ -40,9 +40,16 @@ func TestMain(m *testing.M) {
utilruntime.Must(err)

res := m.Run()
err = utils.PrintSummary(testSummaryOutputEnvVar)
if err != nil {
fmt.Println("PrintSummary error", err)
path := os.Getenv(testSummaryOutputEnvVar)
if path == "" {
fmt.Printf("Note: E2E_SUMMARY_OUTPUT is unset; skipping summary generation")
} else {
err = utils.PrintSummary(path)
if err != nil {
// Fail the run if alerts are found
fmt.Printf("%v", err)
os.Exit(1)
}
}
os.Exit(res)
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/rand"

"github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

// TestOperatorControllerMetricsExportedEndpoint verifies that the metrics endpoint for the operator controller
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/network_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/experimental-e2e/experimental_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
"github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/upgrade-e2e/post_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/test/utils"
utils "github.com/operator-framework/operator-controller/internal/shared/util/testutils"
)

const (
Expand Down