-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
use subtest for table units (pkg/scheduler/factory) #63666
use subtest for table units (pkg/scheduler/factory) #63666
Conversation
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.
Having "Fixes" in the PR description will close the parent issue as soon as this PR is merged. Suggest just /ref the issue instead.
for _, nodeName := range test.cached { | ||
nodeInfo[nodeName] = &schedulercache.NodeInfo{} | ||
} | ||
func testCompareNodes(actual, cached, missing, redundant []string, t *testing.T) { |
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.
Since this helper is called from only one place, why not have the code inline in the anonymous function? (also, helper name is confusingly similar to test name)
} | ||
|
||
} | ||
|
||
func TestSkipPodUpdate(t *testing.T) { | ||
for _, test := range []struct { | ||
table := []struct { |
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.
I see there's already a mix of 'table' and 'tests' in this file. I'd prefer 'tests' in general. Please use that in lines that you are modifying. I'd say you don't have to worry about existing uses of 'table' if you are not touching those lines.
} | ||
t.Run(name, func(t *testing.T) { | ||
if !validName.MatchString(name) { | ||
t.Errorf("should be a valid algorithm name but is not valid.") |
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.
Since the subtest replaces some special chars with underscore, I wonder if we should keep the old format string here. WDYT?
/ok-to-test |
FYI: internal cleanups probably do not need release notes. |
26afed2
to
c6379ce
Compare
/test pull-kubernetes-bazel-test |
/assign @misterikkit |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, k82cn, xchapter7x 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 |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
Automatic merge from submit-queue (batch tested with PRs 58487, 63666). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it: Update scheduler's unit table tests to use subtest
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Special notes for your reviewer:
breaks up PR: #63281
/ref #63267
Release note: