Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for gclient package #5300

Closed
anujagrawal699 opened this issue Aug 5, 2024 · 2 comments
Closed

Add unit tests for gclient package #5300

anujagrawal699 opened this issue Aug 5, 2024 · 2 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@anujagrawal699
Copy link
Contributor

anujagrawal699 commented Aug 5, 2024

While working with the gclient package, I noticed that there are currently no unit tests for this package. Adding tests would improve the reliability and maintainability of this important component.

Current situation:

  • The gclient package lacks unit tests, making it difficult to ensure its functionality and catch potential regressions.

Proposed changes:

  1. Create a new file gclient_test.go in the gclient package.
  2. Implement the following tests:
    a. TestNewSchema: Verify that NewSchema() returns a non-nil schema.
    b. TestNewForConfig: Test NewForConfig() with both valid and invalid configurations.
    c. TestNewForConfigOrDie: Test TestNewForConfigOrDieWithValidConfig() with a valid configuration.
    d. TestAggregatedScheme: Verify that the aggregated scheme includes expected types.
  3. Ensure a test coverage upto 90%.

This is a sub-task of #5236

These tests will:

  • Ensure the basic functionality of the gclient package
  • Improve code coverage
  • Serve as documentation for expected behavior
  • Help catch potential issues in future changes

I'm willing to submit a pull request with these new tests.

@anujagrawal699 anujagrawal699 added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 5, 2024
@karmada-bot
Copy link
Collaborator

@anujagrawal699: The label(s) kind/enhancement, area/testing cannot be applied, because the repository doesn't have them.

In response to this:

While working with the gclient package, I noticed that there are currently no unit tests for this package. Adding tests would improve the reliability and maintainability of this important component.

Current situation:

  • The gclient package lacks unit tests, making it difficult to ensure its functionality and catch potential regressions.

Proposed changes:

  1. Create a new file gclient_test.go in the gclient package.
  2. Implement the following tests:
    a. TestNewSchema: Verify that NewSchema() returns a non-nil schema.
    b. TestNewForConfig: Test NewForConfig() with both valid and invalid configurations.
    c. TestNewForConfigOrDie: Test TestNewForConfigOrDieWithValidConfig() with a valid configuration.
    d. TestAggregatedScheme: Verify that the aggregated scheme includes expected types.
  3. Ensure a test coverage upto 90%.

These tests will:

  • Ensure the basic functionality of the gclient package
  • Improve code coverage
  • Serve as documentation for expected behavior
  • Help catch potential issues in future changes

I'm willing to submit a pull request with these new tests.

/kind enhancement
/area testing

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.

@liangyuanpeng
Copy link
Contributor

/assign anujagrawal699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

3 participants