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

pkg/karmadactl/util: unit test apiclient #5869

Merged

Conversation

mohamedawnallah
Copy link
Contributor

Description

In this commit, we unit test the apiclient to verify the creation of a restconfig in both scenarios: when it exists and when it doesn't.

What type of PR is this?

Which issue(s) this PR fixes:
Part of #5491.

Does this PR introduce a user-facing change?:

NONE

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 71.42857% with 12 lines in your changes missing coverage. Please review.

Project coverage is 48.18%. Comparing base (8457cd2) to head (6ae8cfd).

Files with missing lines Patch % Lines
pkg/util/testing/helpers.go 75.00% 6 Missing and 3 partials ⚠️
pkg/karmadactl/util/apiclient/apiclient.go 50.00% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5869      +/-   ##
==========================================
+ Coverage   48.10%   48.18%   +0.07%     
==========================================
  Files         663      664       +1     
  Lines       54769    54803      +34     
==========================================
+ Hits        26349    26405      +56     
+ Misses      26711    26684      -27     
- Partials     1709     1714       +5     
Flag Coverage Δ
unittests 48.18% <71.42%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhzhuang-zju
Copy link
Contributor

https://github.com/karmada-io/karmada/actions/runs/12002263981/job/33454119362?pr=5869#step:4:14995
pkg/search.TestUpdateResourceRegistryEventHandler/AddAllEventHandlers_TriggerUpdateResourceRegistryEvent_UpdatedResourceRegistryAddedToWorkQueue

/retest

@mohamedawnallah mohamedawnallah force-pushed the unitTestAPIClientUtil branch 3 times, most recently from 514d62c to 6651ccd Compare December 11, 2024 05:59
In this commit, we unit test apiclient on creating restconfig.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
@zhzhuang-zju
Copy link
Contributor

/lgtm
thanks, ask @XiShanYongYe-Chang for another look

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2024
@XiShanYongYe-Chang
Copy link
Member

Thanks guys
/assign

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

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

The pull request process is described here

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 12, 2024
@karmada-bot karmada-bot merged commit 44b59a7 into karmada-io:master Dec 12, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants