-
Notifications
You must be signed in to change notification settings - Fork 772
test(runtime): add UT for jobset runtime valid function. #2562
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
test(runtime): add UT for jobset runtime valid function. #2562
Conversation
/ok-to-test |
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.
Other LGTM, Thanks for your contribution.
cc @tenzen-y
if err != nil { | ||
t.Fatalf("Failed to initialize JobSet plugin: %v", err) | ||
} | ||
warnings, errs := p.(framework.CustomValidationPlugin).Validate(tc.runtimeJobTemplate, nil, tc.oldObj, tc.newObj) |
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.
Upstream has update the Validate functions, you can rebase your commit to main
and remove fist params here.
}, | ||
}, | ||
"model intializer job exists but container missing ": { | ||
runtimeJobTemplate: func() client.Object { |
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.
Ditto, you can remove it because we don't need runtimeJobTemplate
now.
func (j *JobSet) Validate(info *runtime.Info, _, newObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) {
}, | ||
// assert that we get a error here | ||
"dataset initializer job exists but container missing": { | ||
runtimeJobTemplate: func() client.Object { |
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.
Ditto, you can remove it.
}, | ||
}, | ||
"no model intializer job": { | ||
runtimeJobTemplate: utiltesting.MakeJobSetWrapper(metav1.NamespaceDefault, "test"), |
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.
Ditto, you can remove it.
Obj(), | ||
}, | ||
"no dataset intializer job": { | ||
runtimeJobTemplate: utiltesting.MakeJobSetWrapper(metav1.NamespaceDefault, "test"), |
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.
Ditto, you can remove it.
Obj(), | ||
}, | ||
"no initializer job": { | ||
runtimeJobTemplate: utiltesting.MakeJobSetWrapper(metav1.NamespaceDefault, "test"), |
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.
Ditto, you can remove it.
wantWarnings admission.Warnings | ||
}{ | ||
"no jobset runtime template": { | ||
runtimeJobTemplate: &utiltesting.JobSetWrapper{}, |
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.
Ditto, you can remove it.
7262c2e
to
7714e17
Compare
@IRONICBo I updated the entire test . Can you have a look |
@tenzen-y I have removed the test case where |
/rerun-all |
Pull Request Test Coverage Report for Build 14470201388Details
💛 - Coveralls |
/rerun-all |
@IRONICBo Can you please rerun the workflows there was a |
/rerun-all |
OK |
Thank you! |
Hi @IRONICBo , I recently raised two PRs for Kubeflow Trainer, both of which passed all checks. One of them was reviewed by @tenzen-y , but it hasn’t been merged yet as no approvals or suggestions were provided by the reviewers. Could you clarify if there’s a specific process for PRs to get merged? Should I wait for approval, or is there something I should do to get more reviewer attention? |
I am not sure, and you may need to wait for other reviewers to process it, other reviews may be busy with other threads. |
@tenzen-y Could you please review this PR ? |
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.
Thank you
Basically, lgtm
I added a few nit comments.
@@ -325,3 +329,211 @@ func TestJobSet(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestJobSetValidate(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.
func TestJobSetValidate(t *testing.T) { | |
func TestValidate(t *testing.T) { |
In Go, we use Test
prefix as a Test function name.
func TestJobSetValidate(t *testing.T) { | ||
cases := map[string]struct { | ||
info *runtime.Info | ||
_ *trainer.TrainJob |
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.
_ *trainer.TrainJob |
This is unused field.
if err != nil { | ||
t.Fatalf("Failed to initialize JobSet plugin: %v", err) | ||
} | ||
|
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.
Initializer(&trainer.Initializer{Dataset: nil}). | ||
Obj(), | ||
}, | ||
"must have dataset initializer job when trainJob is configured with input datasetConfig": { |
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.
"must have dataset initializer job when trainJob is configured with input datasetConfig": { | |
"must have dataset initializer job when trainJob is configured with input datasetConfig": { |
Signed-off-by: Harshal292004 <malaniharshal95@gmail.com>
Signed-off-by: Harshal292004 <malaniharshal95@gmail.com>
Signed-off-by: Harshal292004 <malaniharshal95@gmail.com>
Signed-off-by: Harshal292004 <malaniharshal95@gmail.com>
Signed-off-by: Harshal292004 <malaniharshal95@gmail.com>
b1d6fc8
to
ea3bcb5
Compare
@tenzen-y Updated everything as suggested |
@tenzen-y, I was wondering if there are any significant opportunities for contribution within Kubeflow at the moment? @Electronic-Waste is currently focused on KEP 2401, so there isn’t much for me to do in that area. |
Every contribution is valuable. If you have an interest in any feature development, please contact the issue creator. |
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.
Thank you
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tenzen-y 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 |
What this PR does / why we need it:
Add fine grained UT for
jobset
runtimeValidate
function.Which issue(s) this PR fixes
Fixes #2556
Checklist: