✨ feature : Add unit tests for utility functions in util_test.go#654
✨ feature : Add unit tests for utility functions in util_test.go#654adity1raut wants to merge 1 commit intokubestellar:mainfrom
Conversation
Signed-off-by: adity1raut <araut7798@gmail.com>
|
[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 |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
|
Hi @adity1raut. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/cc @MikeSpreitzer |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive unit tests for utility functions in pkg/util/util.go, addressing issue #632. The tests cover 14 utility functions with various edge cases and scenarios.
Changes:
- Added unit tests for string manipulation utilities (namespace, DNS name, and bootstrap secret generation)
- Added unit tests for control plane type mapping functions (kubeconfig secrets, API server deployments)
- Added unit tests for helper functions (version parsing, in-cluster detection, field zeroing, and default string handling)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: "single part version", | ||
| versionString: "1", | ||
| expected: "1", |
There was a problem hiding this comment.
This test case validates that a single-part version returns itself, which is correct. However, the implementation also prints a warning to stderr for this case. Consider adding a comment explaining this behavior or testing that the warning is indeed printed when this edge case occurs.
|
/ok-to-test |
Summary
✨ feature : Add unit tests for utility functions in util_test.go
Related issue(s)
Fixes #632