CNTRLPLANE-3890: Add product-cli unit tests for HCP create cluster#9107
CNTRLPLANE-3890: Add product-cli unit tests for HCP create cluster#9107mehabhalodiya wants to merge 1 commit into
Conversation
|
@mehabhalodiya: This pull request references CNTRLPLANE-3890 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 task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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. |
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds parallelized Go tests for the agent, AWS, KubeVirt, and OpenStack cluster create commands. The tests verify command names, expected flag registration, default values, required-flag annotations, developer-only flag exclusions, and exact flag sets. AWS coverage also validates release stream defaults and credential flags. Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mehabhalodiya The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9107 +/- ##
==========================================
+ Coverage 44.51% 44.56% +0.04%
==========================================
Files 774 774
Lines 96997 96997
==========================================
+ Hits 43179 43225 +46
+ Misses 50830 50780 -50
- Partials 2988 2992 +4 see 4 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
product-cli/cmd/cluster/openstack/create_test.go (1)
17-93: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding a developer-only flag exclusion subtest for consistency.
Agent, AWS, and KubeVirt sibling test files each assert specific developer-only flags are absent; this file doesn't. Optional for consistency across the cohort, not blocking.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@product-cli/cmd/cluster/openstack/create_test.go` around lines 17 - 93, Optionally add a developer-only flag exclusion subtest alongside the existing NewCreateCommand flag tests, asserting the relevant developer-only flags are absent for the OpenStack create command. Follow the corresponding exclusion assertions in the Agent, AWS, and KubeVirt sibling tests while keeping the existing expected-flags coverage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@product-cli/cmd/cluster/agent/create_test.go`:
- Around line 44-62: The required-flag tests are vacuous because they mark
pull-secret on a synthetic parent instead of verifying command wiring. In
product-cli/cmd/cluster/agent/create_test.go lines 44-62 and
product-cli/cmd/cluster/aws/create_test.go lines 99-117, add each command to the
actual cluster parent setup, remove the test’s manual MarkPersistentFlagRequired
call, and assert the inherited pull-secret flag on the resulting command tree.
---
Nitpick comments:
In `@product-cli/cmd/cluster/openstack/create_test.go`:
- Around line 17-93: Optionally add a developer-only flag exclusion subtest
alongside the existing NewCreateCommand flag tests, asserting the relevant
developer-only flags are absent for the OpenStack create command. Follow the
corresponding exclusion assertions in the Agent, AWS, and KubeVirt sibling tests
while keeping the existing expected-flags coverage unchanged.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 090e068f-c65a-4316-a888-5edb8e0ee03f
📒 Files selected for processing (4)
product-cli/cmd/cluster/agent/create_test.goproduct-cli/cmd/cluster/aws/create_test.goproduct-cli/cmd/cluster/kubevirt/create_test.goproduct-cli/cmd/cluster/openstack/create_test.go
c494b6b to
1b8806c
Compare
The four platforms — AWS, KubeVirt, OpenStack, and Agent — have no product-cli cluster creation tests at all. Signed-off-by: mehabhalodiya <mehabhalodiya@gmail.com>
1b8806c to
de0d041
Compare
|
@mehabhalodiya: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
The four platforms — AWS, KubeVirt, OpenStack, and Agent — have no product-cli cluster creation tests at all.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-3890
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit