-
Notifications
You must be signed in to change notification settings - Fork 892
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 first part of unit tests for pkg/scheduler #5680
Added first part of unit tests for pkg/scheduler #5680
Conversation
@XiShanYongYe-Chang Please take a look. |
Hi @anujagrawal699 these methods need to be defined:
|
Thanks @XiShanYongYe-Chang , how can i split mocks in a split of a single file. Should i commit mocks in both parts? |
In my opinion, the mock parts can be submitted together and do not need to be split separately. |
But if i commit it in one part, the mocks will be undefined in other. Similarly for imports, and unused mocks in a commit will give lint errors. |
Add only the mock function required by each pr. When one pr is integrated, rebase the code and delete unnecessary code. |
Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com> Added first part of unit tests for pkg/scheduler Signed-off-by: Anuj Agrawal <anujagrawal380@gmail.com>
458b7d2
to
0d6d2d7
Compare
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 #5680 +/- ##
==========================================
+ Coverage 35.19% 38.33% +3.13%
==========================================
Files 645 649 +4
Lines 44869 45133 +264
==========================================
+ Hits 15792 17302 +1510
+ Misses 27846 26511 -1335
- Partials 1231 1320 +89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@XiShanYongYe-Chang Please take a look! |
Thanks~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/lgtm
/approve
[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 |
Description:
This PR significantly enhances the unit tests for the scheduler package and is the first part of unit tests for it. The improvements aim to increase code reliability, maintainability, and test coverage for various scheduler functions.
Note:
The CI tests will fail because the mocks needed for tests are included in second part of unit tests for scheduler module.
Modifications:
pkg/scheduler/scheduler_test.go
Key Improvements:
Added tests for doSchedule, doScheduleBinding, and doScheduleClusterBinding functions.
Added tests for scheduleResourceBindingWithClusterAffinity and scheduleResourceBindingWithClusterAffinities.
Added tests for patchScheduleResultForResourceBinding.
Test Coverage:
pkg/scheduler/scheduler_test.go: 29.71% to 66.90%
What type of PR is this?
/kind feature
Which issue(s) this PR fixes:
Fixes a part of #5470
Does this PR introduce a user-facing change?: