-
Notifications
You must be signed in to change notification settings - Fork 885
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
Added tests for pkg/util/hash #5344
Added tests for pkg/util/hash #5344
Conversation
Signed-off-by: Anuj Agrawal <[email protected]>
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5344 +/- ##
==========================================
- Coverage 28.53% 28.53% -0.01%
==========================================
Files 632 632
Lines 43856 43856
==========================================
- Hits 12515 12514 -1
- Misses 30443 30444 +1
Partials 898 898
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @anujagrawal699, the target file has been overwritten by the test, ref: https://app.codecov.io/gh/karmada-io/karmada/tree/master/pkg%2Futil%2Fhash |
Thanks @XiShanYongYe-Chang . I'm not able to find indication of any direct overwriting of the hash.go file. Could you help me troubleshoot? |
Maybe the function is called where the test already covers the target logic. |
So, i think the pr is not necessary for it. Should i close it? |
Yes, let's close it @anujagrawal699 thanks~ |
Description:
This PR introduces unit tests for the hash package to ensure its functionality and maintainability. Currently, the package lacks unit tests, making it difficult to catch potential regressions and verify its behavior. By adding these tests, we aim to improve the reliability and code coverage of this critical component. The code coverage of the package is 100%.
Implemented Test:
TestDeepHashObject(): Verifies that the DeepHashObject function produces consistent hashes for various input types.
What type of PR is this?
/kind failing-test
/kind feature
Test Coverage:
The hash package lacked unit tests and thus implementing this tests increased it's test coverage from 0% to 100%. This can be verified in the file directory i.e. pkg/util/hash using command
go test -coverprofile=coverage.out
What this PR does / why we need it:
The tests introduced in this PR will:
Ensure the basic functionality of the hash package
Improve test coverage of the hash package
Serve as documentation for expected behavior
Help catch potential issues in future changes
Which issue(s) this PR fixes:
Fixes part of #5235
Does this PR introduce a user-facing change?: