Skip to content

✨ feature : Add unit tests for utility functions in util_test.go#654

Open
adity1raut wants to merge 1 commit intokubestellar:mainfrom
adity1raut:util
Open

✨ feature : Add unit tests for utility functions in util_test.go#654
adity1raut wants to merge 1 commit intokubestellar:mainfrom
adity1raut:util

Conversation

@adity1raut
Copy link
Copy Markdown
Contributor

Summary

✨ feature : Add unit tests for utility functions in util_test.go

Related issue(s)

Fixes #632

Signed-off-by: adity1raut <araut7798@gmail.com>
Copilot AI review requested due to automatic review settings January 15, 2026 04:43
@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rxinui for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jan 15, 2026
@github-actions
Copy link
Copy Markdown

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 git commit -s to certify the Developer Certificate of Origin

PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), ⚠️ (breaking change)

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!

@kubestellar-prow
Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@kubestellar-prow kubestellar-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 15, 2026
@adity1raut
Copy link
Copy Markdown
Contributor Author

/cc @MikeSpreitzer

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +214 to +216
name: "single part version",
versionString: "1",
expected: "1",
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@clubanderson
Copy link
Copy Markdown
Contributor

/ok-to-test

@kubestellar-prow kubestellar-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Improve Unit Test Coverage Across the Project

3 participants