-
-
Notifications
You must be signed in to change notification settings - Fork 35
fix: add ut for modelhub. #434
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
fix: add ut for modelhub. #434
Conversation
ad18539
to
4a23bbf
Compare
/kind cleanup |
/assign |
for _, key := range tc.expectEnvContains { | ||
found := false | ||
for _, env := range initContainer.Env { | ||
if env.Name == key { | ||
found = true | ||
break | ||
} | ||
} | ||
assert.True(t, found, "expected env %s not found", key) | ||
} | ||
|
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.
Why do we only check the key (the same applies to other tests) but not the value? If I understand correctly, we should also be able to use diff := cmp.Diff
to implement this test. In addition, I recommend using cmp.Diff to reduce the time complexity, even though the amount of data in the unit test is very small.
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.
Make sense, I think cmp
is better, I will update it quickly, thank you very much.
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.
friendly ping @googs1025 , do you have time to take a look?
a2d4b1c
to
e70bd18
Compare
}) | ||
|
||
for _, tt := range tests { | ||
// tt := tt |
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.
can we remove this?
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.
Oh, I have removed it, thank you.
other part LGTM |
e70bd18
to
d5e1341
Compare
Signed-off-by: X1aoZEOuO <nizefeng2002@outlook.com>
d5e1341
to
8523390
Compare
Signed-off-by: X1aoZEOuO <nizefeng2002@outlook.com>
8523390
to
f88ef2d
Compare
Please take a look, thank you! @kerthcet |
/approve |
/lgtm |
What this PR does / why we need it
Add mode unit tests for backend runtime.
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
From:
To:
cc @kerthcet
Does this PR introduce a user-facing change?