Skip to content

test: add Unit Test Coverage for Reflect Util#1026

Open
kartikangiras wants to merge 2 commits into
goharbor:mainfrom
kartikangiras:test/reflectutil
Open

test: add Unit Test Coverage for Reflect Util#1026
kartikangiras wants to merge 2 commits into
goharbor:mainfrom
kartikangiras:test/reflectutil

Conversation

@kartikangiras

Copy link
Copy Markdown

Description

Add unit test coverage for pkg/utils/reflect.go (ExtractConfigValues, ConvertToConfigurations, ExtractConfigurationsByCategory, IsCategory).

Type of Change

Please select the relevant type.

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Chore / maintenance

Changes

  • pkg/utils/reflect_test.go: 8 tests for config extraction, conversion, category filtering, and nil safety

@qcserestipy qcserestipy added the status/in-progress Work on this issue has started or a linked pull request is actively being developed. label Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 unit tests for the reflection-based configuration utilities in pkg/utils/reflect.go, improving confidence in config extraction/conversion and category filtering logic used by the CLI.

Changes:

  • Add unit tests for ExtractConfigValues across Configurations and ConfigurationsResponse, including nil/empty-string handling.
  • Add unit tests for ConvertToConfigurations, ExtractConfigurationsByCategory, and IsCategory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/utils/reflect_test.go
Comment thread pkg/utils/reflect_test.go
Signed-off-by: Kartik Angiras <angiraskartik@gmail.com>
Signed-off-by: Kartik Angiras <angiraskartik@gmail.com>
@kartikangiras

Copy link
Copy Markdown
Author

Hey @qcserestipy , I have made changes and resolved the review remarks. Could you PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/in-progress Work on this issue has started or a linked pull request is actively being developed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Add Unit Test coverage for Utils

3 participants