Skip to content

Conversation

@wangke19
Copy link
Contributor

@wangke19 wangke19 commented Dec 25, 2025

Summary

This PR adds E2E tests for cluster-config-operator health verification using the OpenShift Tests Extension (OTE) framework with Ginkgo. This builds on PR #457 which refactored the test infrastructure.

Changes

Commit 1: Infrastructure Code

  • test/e2e/helpers.go (42 lines) - Shared test utilities

    • Kubernetes client setup with kubeconfig loading
    • Common constants (namespaces, timeouts)
    • Helper functions (testContext, int64Ptr)
  • test/e2e/operator_health.go (94 lines) - Operator health tests

    • [Operator][Serial] Operator Health Deployment Verification
      • Verifies deployment exists and has ready replicas
    • [Operator][Serial] Operator Health Pod Health
      • Verifies pods are running without fatal errors in logs
  • cmd/cluster-config-operator-tests-ext/main.go - OTE integration

    • Build Ginkgo test specs from test suite
    • Register test suite: openshift/cluster-config-operator/Operator/Serial
    • Improved error handling
  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go (8 lines)

    • Blank import to register tests with OTE framework

Commit 2: Dependencies

  • Added Ginkgo v2 (OCP fork) for BDD testing
  • Added Gomega for assertions
  • Added OTE Ginkgo integration package
  • Vendored all dependencies

Test Coverage

2 tests added:

  1. Deployment verification (ready replicas >= 1)
  2. Pod health verification (running state + log checks for fatal errors)

Testing

# Build
make build

# List tests
./cluster-config-operator-tests-ext list tests --suite=openshift/cluster-config-operator/Operator/Serial

# Run tests (requires KUBECONFIG)
export KUBECONFIG=/path/to/kubeconfig
./cluster-config-operator-tests-ext run-suite openshift/cluster-config-operator/Operator/Serial

References

Notes

  • Tests are labeled with [Operator][Serial] for proper categorization
  • Total new code: ~144 lines (infrastructure), well within 200-400 line target
  • Vendor directory: +260 files (standard for Ginkgo/Gomega dependencies)

@coderabbitai
Copy link

coderabbitai bot commented Dec 25, 2025

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR adds end-to-end testing infrastructure for the cluster-config-operator, including modifications to the test extension registry, Ginkgo test spec integration, test helper utilities, and operator health verification tests.

Changes

Cohort / File(s) Summary
Test Extension Infrastructure
cmd/cluster-config-operator-tests-ext/dependencymagnet.go, cmd/cluster-config-operator-tests-ext/main.go
Adds blank import file to trigger test package initialization. Updates main.go to return errors from newOperatorTestCommand() and prepareOperatorTestsRegistry(), integrates Ginkgo test spec building via BuildExtensionTestSpecsFromOpenShiftGinkgoSuite, and adds error handling in main.
Dependencies
go.mod
Promotes github.com/onsi/ginkgo/v2 and github.com/onsi/gomega from indirect to direct dependencies, adds slim-sprig/v3 and golang.org/x/tools as indirect dependencies.
E2E Test Infrastructure
test/e2e/helpers.go, test/e2e/operator_health.go
Introduces helpers.go with Kubernetes client utilities, REST config loading, test context, and pointer helpers. Adds operator_health.go with tests verifying operator Deployment readiness and pod health (Running state, container logs scanned for fatal/panic messages).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wangke19
Once this PR has been reviewed and has the lgtm label, please assign benluddy for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between b58d2c2 and 0b8a48c.

⛔ Files ignored due to path filters (259)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/go-task/slim-sprig/v3/.editorconfig is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/.gitattributes is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/LICENSE.txt is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/Taskfile.yml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/crypto.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/date.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/defaults.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/dict.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/doc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/functions.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/list.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/network.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/numeric.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/reflect.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/regex.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/strings.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/url.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/CONTRIBUTING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/Makefile is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/OWNERS is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/RELEASING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/config/deprecated.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/core_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/deprecated_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/colorable_others.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/colorable_windows.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/abort.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/boostrap_templates.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/bootstrap_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/gocovmerge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/test_suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/utils.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/verify_version.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/labels/labels_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/import.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/unfocus/unfocus_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/delta.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/delta_tracker.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/package_hash.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/package_hashes.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo_cli_dependencies.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/counter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/failer.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/focus.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/global/init.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/group.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/interrupt_handler.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_windows.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/ordering.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/client_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/http_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/http_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/rpc_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/rpc_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/server_handler.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_bsd.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_wasm.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_win.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_reporter_manager.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/report_entry.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/tree.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/writer.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/deprecated_reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/table_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/code_location.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/config.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/deprecated_types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/deprecation_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/enum_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/errors.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/file_filter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/flags.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/label_filter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/report_entry.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/types_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/version.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/CONTRIBUTING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/RELEASING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/format/format.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/gomega_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/assertion.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/async_assertion.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/duration_bundle.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gomega.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gutil/post_ioutil.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gutil/using_ioutil.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/polling_signal_error.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/vetoptdesc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/and.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/attributes_slice.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_a_directory.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_false_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_identical_to.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_key_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_true_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/consist_of.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_elements_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/equal_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_each_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_exact_elements.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_existing_field_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_field.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_body_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_header_with_value_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_status_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_key_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_len_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_prefix_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_suffix_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_value.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_noiter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_error_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_json_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_regexp_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_xml_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/not.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/or.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/panic_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/receive_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/satisfy_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/succeed_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/edge/edge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/util/util.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/type_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/with_transform.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/types/types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/parallel.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/util.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/atom/atom.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/atom/table.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/charset/charset.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/const.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/doc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/doctype.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/entity.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/escape.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/foreign.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/parse.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/render.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/token.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/charmap/charmap.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/charmap/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/encoding.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/map.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/identifier/identifier.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/identifier/mib.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/internal.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/all.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/eucjp.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/iso2022jp.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/shiftjis.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/korean/euckr.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/korean/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/all.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/traditionalchinese/big5.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/traditionalchinese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/unicode/override.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/unicode/unicode.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/internal/utf8internal/utf8internal.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/runes/cond.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/runes/runes.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/PATENTS is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/cover/profile.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/edge/edge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/cursor.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/inspector.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/typeof.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/walk.go is excluded by !vendor/**, !**/vendor/**
  • vendor/modules.txt is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (5)
  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go
  • cmd/cluster-config-operator-tests-ext/main.go
  • go.mod
  • test/e2e/helpers.go
  • test/e2e/operator_health.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/operator_health.go
  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go
  • cmd/cluster-config-operator-tests-ext/main.go
  • test/e2e/helpers.go
  • go.mod
🔇 Additional comments (7)
cmd/cluster-config-operator-tests-ext/dependencymagnet.go (1)

1-8: LGTM!

Standard dependency magnet pattern to trigger test registration via blank import. The comment clearly explains the purpose.

go.mod (1)

10-11: LGTM!

Promoting Ginkgo/Gomega to direct dependencies aligns with the new e2e test infrastructure. The replace directive for the OCP fork is properly documented.

test/e2e/operator_health.go (1)

19-36: LGTM!

The deployment verification logic is sound - using Eventually with appropriate timeout for the deployment to become ready is the correct pattern.

test/e2e/helpers.go (2)

12-18: LGTM!

Constants are well-organized with reasonable polling defaults. Note that clusterOperatorName appears unused in the current tests—presumably reserved for future ClusterOperator status checks.


20-45: LGTM!

The helper functions follow standard client-go patterns for loading kubeconfig and creating clients. Clean and reusable utilities.

cmd/cluster-config-operator-tests-ext/main.go (2)

24-31: LGTM!

Good error handling pattern—failing early with klog.Fatal if command initialization fails prevents running with an incomplete registry.


67-90: Specs are automatically associated with the suite via implicit source-based filtering.

The OTE framework automatically associates specs with suites through the source field. When AddSpecs() is called, each spec's source is set to the component identifier (openshift:payload:cluster-config-operator). When AddSuite() is called without explicit qualifiers, it automatically adds a qualifier source == "openshift:payload:cluster-config-operator", which includes all specs from that extension. No explicit association is required; this is handled implicitly by the framework.

Comment on lines +76 to +84
// Check for fatal errors in logs
scanner := bufio.NewScanner(strings.NewReader(string(podLogs)))
for scanner.Scan() {
line := scanner.Text()
if strings.Contains(strings.ToLower(line), "fatal") ||
strings.Contains(strings.ToLower(line), "panic") {
g.Fail(fmt.Sprintf("found fatal error in pod %s logs: %s", pod.Name, line))
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Log scanning may produce false positives.

The case-insensitive substring match for "fatal" and "panic" could flag benign log lines such as "no fatal errors found" or "panic recovery handler registered". Consider tightening the pattern—for example, matching common structured log prefixes like "F" or "level=fatal", or using a regex that checks for word boundaries.

🔎 Example of a tighter check
 				for scanner.Scan() {
 					line := scanner.Text()
-					if strings.Contains(strings.ToLower(line), "fatal") ||
-						strings.Contains(strings.ToLower(line), "panic") {
+					lower := strings.ToLower(line)
+					// Match klog fatal prefix or explicit panic indicators
+					if strings.HasPrefix(line, "F") || // klog fatal lines start with F
+						strings.Contains(lower, "level=fatal") ||
+						strings.Contains(lower, "panic:") {
 						g.Fail(fmt.Sprintf("found fatal error in pod %s logs: %s", pod.Name, line))
 					}
 				}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Check for fatal errors in logs
scanner := bufio.NewScanner(strings.NewReader(string(podLogs)))
for scanner.Scan() {
line := scanner.Text()
if strings.Contains(strings.ToLower(line), "fatal") ||
strings.Contains(strings.ToLower(line), "panic") {
g.Fail(fmt.Sprintf("found fatal error in pod %s logs: %s", pod.Name, line))
}
}
// Check for fatal errors in logs
scanner := bufio.NewScanner(strings.NewReader(string(podLogs)))
for scanner.Scan() {
line := scanner.Text()
lower := strings.ToLower(line)
// Match klog fatal prefix or explicit panic indicators
if strings.HasPrefix(line, "F") || // klog fatal lines start with F
strings.Contains(lower, "level=fatal") ||
strings.Contains(lower, "panic:") {
g.Fail(fmt.Sprintf("found fatal error in pod %s logs: %s", pod.Name, line))
}
}
🤖 Prompt for AI Agents
In test/e2e/operator_health.go around lines 76 to 84, the current
case-insensitive substring checks for "fatal" and "panic" produce false
positives; replace them with a stricter regex-based check that matches log-level
patterns and whole words (e.g. \bpanic\b, \bfatal\b) and common structured keys
like level=fatal, "level":"fatal", or a single-letter prefix used by the logger
(e.g. ^F\d or ^P\d) using case-insensitive matching; compile the regex once,
test each log line against it, and only fail when the regex matches (optionally
also exclude obvious negations like lines starting with "no " or containing "no
fatal" before failing).

@wangke19 wangke19 changed the title Add operator health E2E tests [WIP]CNTRLPLANE-2273:Add operator health E2E tests Dec 25, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 25, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 25, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 25, 2025

@wangke19: This pull request references CNTRLPLANE-2273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds E2E tests for cluster-config-operator health verification using the OpenShift Tests Extension (OTE) framework with Ginkgo. This builds on PR #457 which refactored the test infrastructure.

Changes

Commit 1: Infrastructure Code

  • test/e2e/helpers.go (42 lines) - Shared test utilities

  • Kubernetes client setup with kubeconfig loading

  • Common constants (namespaces, timeouts)

  • Helper functions (testContext, int64Ptr)

  • test/e2e/operator_health.go (94 lines) - Operator health tests

  • [Operator][Serial] Operator Health Deployment Verification

    • Verifies deployment exists and has ready replicas
  • [Operator][Serial] Operator Health Pod Health

    • Verifies pods are running without fatal errors in logs
  • cmd/cluster-config-operator-tests-ext/main.go - OTE integration

  • Build Ginkgo test specs from test suite

  • Register test suite: openshift/cluster-config-operator/all

  • Improved error handling following oauth-apiserver PR Updating ose-cluster-config-operator builder & base images to be consistent with ART #162 pattern

  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go (8 lines)

  • Blank import to register tests with OTE framework

Commit 2: Dependencies

  • Added Ginkgo v2 (OCP fork) for BDD testing
  • Added Gomega for assertions
  • Added OTE Ginkgo integration package
  • Vendored all dependencies

Test Coverage

2 tests added:

  1. Deployment verification (ready replicas >= 1)
  2. Pod health verification (running state + log checks for fatal errors)

Testing

# Build
make build

# List tests
./cluster-config-operator-tests-ext list tests --suite=openshift/cluster-config-operator/all

# Run tests (requires KUBECONFIG)
export KUBECONFIG=/path/to/kubeconfig
./cluster-config-operator-tests-ext run-suite openshift/cluster-config-operator/all

References

Notes

  • Tests use g and o import aliases for Ginkgo and Gomega (OpenShift convention)
  • Tests are labeled with [Operator][Serial] for proper categorization
  • Total new code: ~144 lines (infrastructure), well within 200-400 line target
  • Vendor directory: +260 files (standard for Ginkgo/Gomega dependencies)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 25, 2025

@wangke19: This pull request references CNTRLPLANE-2273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds E2E tests for cluster-config-operator health verification using the OpenShift Tests Extension (OTE) framework with Ginkgo. This builds on PR #457 which refactored the test infrastructure.

Changes

Commit 1: Infrastructure Code

  • test/e2e/helpers.go (42 lines) - Shared test utilities

  • Kubernetes client setup with kubeconfig loading

  • Common constants (namespaces, timeouts)

  • Helper functions (testContext, int64Ptr)

  • test/e2e/operator_health.go (94 lines) - Operator health tests

  • [Operator][Serial] Operator Health Deployment Verification

    • Verifies deployment exists and has ready replicas
  • [Operator][Serial] Operator Health Pod Health

    • Verifies pods are running without fatal errors in logs
  • cmd/cluster-config-operator-tests-ext/main.go - OTE integration

  • Build Ginkgo test specs from test suite

  • Register test suite: openshift/cluster-config-operator/all

  • Improved error handling

  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go (8 lines)

  • Blank import to register tests with OTE framework

Commit 2: Dependencies

  • Added Ginkgo v2 (OCP fork) for BDD testing
  • Added Gomega for assertions
  • Added OTE Ginkgo integration package
  • Vendored all dependencies

Test Coverage

2 tests added:

  1. Deployment verification (ready replicas >= 1)
  2. Pod health verification (running state + log checks for fatal errors)

Testing

# Build
make build

# List tests
./cluster-config-operator-tests-ext list tests --suite=openshift/cluster-config-operator/all

# Run tests (requires KUBECONFIG)
export KUBECONFIG=/path/to/kubeconfig
./cluster-config-operator-tests-ext run-suite openshift/cluster-config-operator/all

References

Notes

  • Tests use g and o import aliases for Ginkgo and Gomega (OpenShift convention)
  • Tests are labeled with [Operator][Serial] for proper categorization
  • Total new code: ~144 lines (infrastructure), well within 200-400 line target
  • Vendor directory: +260 files (standard for Ginkgo/Gomega dependencies)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 25, 2025

@wangke19: This pull request references CNTRLPLANE-2273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds E2E tests for cluster-config-operator health verification using the OpenShift Tests Extension (OTE) framework with Ginkgo. This builds on PR #457 which refactored the test infrastructure.

Changes

Commit 1: Infrastructure Code

  • test/e2e/helpers.go (42 lines) - Shared test utilities

  • Kubernetes client setup with kubeconfig loading

  • Common constants (namespaces, timeouts)

  • Helper functions (testContext, int64Ptr)

  • test/e2e/operator_health.go (94 lines) - Operator health tests

  • [Operator][Serial] Operator Health Deployment Verification

    • Verifies deployment exists and has ready replicas
  • [Operator][Serial] Operator Health Pod Health

    • Verifies pods are running without fatal errors in logs
  • cmd/cluster-config-operator-tests-ext/main.go - OTE integration

  • Build Ginkgo test specs from test suite

  • Register test suite: openshift/cluster-config-operator/Operator/Serial

  • Improved error handling

  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go (8 lines)

  • Blank import to register tests with OTE framework

Commit 2: Dependencies

  • Added Ginkgo v2 (OCP fork) for BDD testing
  • Added Gomega for assertions
  • Added OTE Ginkgo integration package
  • Vendored all dependencies

Test Coverage

2 tests added:

  1. Deployment verification (ready replicas >= 1)
  2. Pod health verification (running state + log checks for fatal errors)

Testing

# Build
make build

# List tests
./cluster-config-operator-tests-ext list tests --suite=openshift/cluster-config-operator/Operator/Serial

# Run tests (requires KUBECONFIG)
export KUBECONFIG=/path/to/kubeconfig
./cluster-config-operator-tests-ext run-suite openshift/cluster-config-operator/Operator/Serial

References

Notes

  • Tests use g and o import aliases for Ginkgo and Gomega (OpenShift convention)
  • Tests are labeled with [Operator][Serial] for proper categorization
  • Total new code: ~144 lines (infrastructure), well within 200-400 line target
  • Vendor directory: +260 files (standard for Ginkgo/Gomega dependencies)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

This commit adds E2E tests for cluster-config-operator health verification
using the OpenShift Tests Extension (OTE) framework with Ginkgo.

Changes:
- Add test/e2e/helpers.go with shared test utilities and Kubernetes client setup
- Add test/e2e/operator_health.go with 2 operator health tests:
  * Deployment verification (checks ready replicas)
  * Pod health verification (checks running pods and logs for fatal errors)
- Update cmd/cluster-config-operator-tests-ext/main.go to integrate with OTE:
  * Add Ginkgo test spec building
  * Register test suite: openshift/cluster-config-operator/all
  * Improve error handling following oauth-apiserver pattern
- Add cmd/cluster-config-operator-tests-ext/dependencymagnet.go to register tests

Tests are labeled with [Operator][Serial] for proper categorization.
Add required dependencies for Ginkgo-based E2E tests:
- github.com/onsi/ginkgo/v2 (OCP fork for BDD testing)
- github.com/onsi/gomega (assertion library)
- github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo
- Supporting packages: golang.org/x/net, golang.org/x/text, golang.org/x/tools

Updated go.mod, go.sum, and vendored all dependencies.
@wangke19 wangke19 force-pushed the add-operator-health-tests branch from 0b8a48c to ef7a677 Compare December 25, 2025 15:00
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 25, 2025

@wangke19: This pull request references CNTRLPLANE-2273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds E2E tests for cluster-config-operator health verification using the OpenShift Tests Extension (OTE) framework with Ginkgo. This builds on PR #457 which refactored the test infrastructure.

Changes

Commit 1: Infrastructure Code

  • test/e2e/helpers.go (42 lines) - Shared test utilities

  • Kubernetes client setup with kubeconfig loading

  • Common constants (namespaces, timeouts)

  • Helper functions (testContext, int64Ptr)

  • test/e2e/operator_health.go (94 lines) - Operator health tests

  • [Operator][Serial] Operator Health Deployment Verification

    • Verifies deployment exists and has ready replicas
  • [Operator][Serial] Operator Health Pod Health

    • Verifies pods are running without fatal errors in logs
  • cmd/cluster-config-operator-tests-ext/main.go - OTE integration

  • Build Ginkgo test specs from test suite

  • Register test suite: openshift/cluster-config-operator/Operator/Serial

  • Improved error handling

  • cmd/cluster-config-operator-tests-ext/dependencymagnet.go (8 lines)

  • Blank import to register tests with OTE framework

Commit 2: Dependencies

  • Added Ginkgo v2 (OCP fork) for BDD testing
  • Added Gomega for assertions
  • Added OTE Ginkgo integration package
  • Vendored all dependencies

Test Coverage

2 tests added:

  1. Deployment verification (ready replicas >= 1)
  2. Pod health verification (running state + log checks for fatal errors)

Testing

# Build
make build

# List tests
./cluster-config-operator-tests-ext list tests --suite=openshift/cluster-config-operator/Operator/Serial

# Run tests (requires KUBECONFIG)
export KUBECONFIG=/path/to/kubeconfig
./cluster-config-operator-tests-ext run-suite openshift/cluster-config-operator/Operator/Serial

References

Notes

  • Tests are labeled with [Operator][Serial] for proper categorization
  • Total new code: ~144 lines (infrastructure), well within 200-400 line target
  • Vendor directory: +260 files (standard for Ginkgo/Gomega dependencies)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 25, 2025

@wangke19: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-serial-techpreview-1of2 ef7a677 link true /test e2e-aws-serial-techpreview-1of2
ci/prow/okd-scos-images ef7a677 link true /test okd-scos-images
ci/prow/e2e-aws-serial-1of2 ef7a677 link true /test e2e-aws-serial-1of2

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants