[quality] Add coverage for workloads cluster group CRUD/sync handlers#19134
[quality] Add coverage for workloads cluster group CRUD/sync handlers#19134Copilot wants to merge 2 commits into
Conversation
✅ Deploy Preview for kubestellarconsole canceled.
|
|
👋 Hey @Copilot — thanks for opening this PR!
This is an automated message. |
Signed-off-by: GitHub <noreply@github.com>
|
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff:
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
📌 Fixes
📝 Summary of Changes
pkg/api/handlers/workloads/cluster_groups.gohad effectively no direct test coverage across cluster-group CRUD/sync behavior, including admin gating, validation, and persistence interactions. This PR replaces the placeholder test with focused handler-level coverage for the high-risk paths called out in the issue.HTTP behavior coverage
all-healthy-clustersgroup is prepended in list responses.Authorization and mutation safety
403coverage for non-admin access across create/update/delete/sync endpoints.Persistence contract checks
SaveClusterGroupon create/update andDeleteClusterGroupon delete with explicit mock expectations.Example assertion pattern used for persistence payload correctness:
Changes Made
pkg/api/handlers/workloads/cluster_groups_test.goto replace placeholder coverage with real handler testsresetClusterGroups,newJSONRequest) for isolation and readabilityChecklist
Please ensure the following before submitting your PR:
git commit -s)Screenshots or Logs (if applicable)
N/A (Go handler test updates only)
👀 Reviewer Notes