Skip to content

test: cover the remaining ConfigurationServiceOverrider settings - #3586

Merged
csviri merged 1 commit into
operator-framework:mainfrom
csviri:test-configuration-service-overrider-coverage
Sep 3, 2026
Merged

csviri merged 1 commit into
operator-framework:mainfrom
csviri:test-configuration-service-overrider-coverage

Conversation

@csviri

@csviri csviri commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

overrideShouldWork asserted the informer stopped handler override against
getLeaderElectionConfiguration(), so it passed whatever the overrider did with the
handler, and set a resource cloner it never asserted. Fixes both, and adds coverage
for withDependentResourceFactory and withDefaultNonSSAResource, neither of which was
exercised anywhere.

withDependentResourceFactory had no coverage at all: unlike the scalar setters, it is
not reachable through a ConfigLoader binding, so
operatorBindingsCoverAllSingleScalarSettersOnConfigurationServiceOverrider does not
guard it either.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected configuration override validation for informer stopped handlers.
    • Added coverage ensuring resource cloner overrides are honored.
  • Tests

    • Added verification for default and customizable dependent resource factories.
    • Added verification for default non-server-side-applied resource types and their ability to be overridden.

Copilot AI lite review requested due to automatic review settings September 3, 2026 08:40
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank September 3, 2026 08:40
@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 5e84a2fd-2bf6-4736-b7bd-6f107e9cf5f4

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb7675 and 9f6a468.

📒 Files selected for processing (1)
  • operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverriderTest.java

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The test suite adds coverage for configuration defaults and overrides. It also corrects the informer-stopped-handler assertion and verifies resource cloner replacement.

Changes

Configuration override validation

Layer / File(s) Summary
Override defaults and assertions
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverriderTest.java
The tests verify resource cloner replacement, compare the correct informer-stopped handlers, and cover dependent resource factory and non-SSA resource defaults and overrides.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to de927

This adds and corrects configuration override tests without changing production behavior. No current merge-readiness risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding test coverage for the remaining ConfigurationServiceOverrider settings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are limited to test corrections/additions and the new assertions accurately validate the intended override and default behaviors.

Pull request overview

Improves the reliability and completeness of ConfigurationServiceOverrider test coverage in operator-framework-core by fixing incorrect assertions and adding targeted tests for previously unexercised overrider settings.

Changes:

  • Fixes an incorrect assertion that compared the informer-stopped handler override against the leader election configuration.
  • Adds missing assertions for the resource cloner override.
  • Adds new tests covering withDependentResourceFactory and withDefaultNonSSAResource, including default behaviors and override behavior.
File summaries
File Description
operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverriderTest.java Fixes incorrect assertions and expands unit test coverage for remaining ConfigurationServiceOverrider settings.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

overrideShouldWork asserted the informer stopped handler override against
getLeaderElectionConfiguration(), so it passed whatever the overrider did with the
handler, and set a resource cloner it never asserted. Fixes both, and adds coverage
for withDependentResourceFactory and withDefaultNonSSAResource, neither of which was
exercised anywhere.

withDependentResourceFactory had no coverage at all: unlike the scalar setters, it is
not reachable through a ConfigLoader binding, so
operatorBindingsCoverAllSingleScalarSettersOnConfigurationServiceOverrider does not
guard it either.
@csviri
csviri force-pushed the test-configuration-service-overrider-coverage branch from 9f6a468 to de927a1 Compare September 3, 2026 08:56
@csviri
csviri merged commit d470106 into operator-framework:main Sep 3, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants