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.
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.
Make sense, I think cmp is better, I will update it quickly, thank you very much.
There was a problem hiding this comment.
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.
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?