Skip to content

Add MCM modprobe webhook tests (OCP-62605, OCP-62606, OCP-62607)#1337

Open
ItzikEzra-rh wants to merge 1 commit intorh-ecosystem-edge:mainfrom
ItzikEzra-rh:mcm-modprobe-webhook-tests
Open

Add MCM modprobe webhook tests (OCP-62605, OCP-62606, OCP-62607)#1337
ItzikEzra-rh wants to merge 1 commit intorh-ecosystem-edge:mainfrom
ItzikEzra-rh:mcm-modprobe-webhook-tests

Conversation

@ItzikEzra-rh
Copy link
Copy Markdown
Contributor

@ItzikEzra-rh ItzikEzra-rh commented Apr 19, 2026

Summary

  • Add three MCM webhook validation tests mirroring existing Module-side tests:
    • OCP-62607: moduleName vs rawArgs mutual exclusion (mirrors OCP-62600)
    • OCP-62606: rawArgs required when moduleName is unset (mirrors OCP-62599)
    • OCP-62605: update valid MCM with invalid spec (mirrors OCP-62598)
  • All tests validated on OCP 4.18.35 cluster with KMM-Hub 2.6.0 — 7/7 webhook tests pass (4 existing + 3 new)

Test plan

  • Ran mcm-webhook label filter on cluster — all 7 tests pass
  • Verified no leftover MCM resources after test run
  • No eco-goinfra changes needed

Summary by CodeRabbit

  • Tests
    • Strengthened webhook validation test coverage for module configurations, including validation of parameter constraints, container specifications, and module update operations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@ItzikEzra-rh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6fce9183-b251-4bb8-89c0-e02de94ea086

📥 Commits

Reviewing files that changed from the base of the PR and between 17a1ecd and 05f1959.

📒 Files selected for processing (1)
  • tests/hw-accel/kmm/mcm/tests/webhook-test.go
📝 Walkthrough

Walkthrough

Test file receives additions to webhook validation tests, including three new test cases covering scenarios with moduleName/rawArgs conflicts, missing rawArgs validation, and invalid module loader container specifications during updates.

Changes

Cohort / File(s) Summary
Webhook Validation Tests
tests/hw-accel/kmm/mcm/tests/webhook-test.go
Added fmt import and three new test cases covering: moduleName and rawArgs conflict validation, rawArgs requirement when moduleName is unset, and invalid module loader container validation during MCM updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding three new MCM modprobe webhook tests with their corresponding OCP ticket numbers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 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 and usage tips.

Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/hw-accel/kmm/mcm/tests/webhook-test.go`:
- Around line 246-304: After creating the ManagedClusterModule via
NewManagedClusterModuleBuilder(...).Create() and assigning it to mcm,
immediately register cleanup with e.g. DeferCleanup(func() { _, _ = mcm.Delete()
}) (or the appropriate Ginkgo DeferCleanup helper) so the MCM is always removed
even if subsequent Expect calls fail; then remove the manual Delete call at the
end of the spec (the mcm.Delete() block) to avoid double-deletion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cbf0a512-0be9-40df-af4f-387f6284fa6f

📥 Commits

Reviewing files that changed from the base of the PR and between 576df61 and 17a1ecd.

📒 Files selected for processing (1)
  • tests/hw-accel/kmm/mcm/tests/webhook-test.go

Comment thread tests/hw-accel/kmm/mcm/tests/webhook-test.go
Add three webhook validation tests for ManagedClusterModule that mirror
existing Module-side tests:
- OCP-62605: update valid MCM with invalid spec (mirrors OCP-62598)
- OCP-62606: rawArgs required when moduleName unset (mirrors OCP-62599)
- OCP-62607: moduleName vs rawArgs mutual exclusion (mirrors OCP-62600)
@ItzikEzra-rh ItzikEzra-rh force-pushed the mcm-modprobe-webhook-tests branch from 17a1ecd to 05f1959 Compare April 19, 2026 10:37
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.

1 participant