-
Notifications
You must be signed in to change notification settings - Fork 949
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
feature: add volume ls quiet flag support #2464
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2464 +/- ##
==========================================
+ Coverage 68.76% 68.95% +0.19%
==========================================
Files 277 277
Lines 18330 18330
==========================================
+ Hits 12604 12640 +36
+ Misses 4291 4265 -26
+ Partials 1435 1425 -10
|
test/environment/cleanup.go
Outdated
ctx := context.Background() | ||
volumes, err := apiClient.VolumeList(ctx) | ||
if err != nil { | ||
return errors.Wrap(err, "fali to list volumes") |
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.
just one typo: fali
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, update.
96c43dd
to
45e7e3a
Compare
test/cli_volume_test.go
Outdated
c.Assert(len(fields), check.Equals, 1) | ||
|
||
for _, line := range lines { | ||
if strings.Contains(line, volumeName) { |
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.
Maybe we can decrease the indent, WDYT?
45e7e3a
to
ce46678
Compare
Signed-off-by: zhangyue <[email protected]>
ce46678
to
9987860
Compare
we got flaky test or bug here
|
You could add an issue for this. @fuweid |
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.
Basically, LGTM
I think we can do better in test case since the check is not effective with strings.Contain
in the test case, just use |
I did one thing to parse the table into map[string][]string for image list. I think we should handle the table like this. It can make the test code readable and easy to understand. Just proposal. |
Yes, I come into the problem too when I impl the test case, but the other cli volume test case have the same problem, prepare to file a another pr to handle this, @fuweid WDYT? |
Sure! |
Signed-off-by: zhangyue [email protected]
Ⅰ. Describe what this PR did
add
pouch volume list
--quiet flag to support only show volume name.Ⅱ. Does this pull request fix one issue?
fix #2462 feature request.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Add integration test case.
Ⅳ. Describe how to verify it
pouch volume ls --quiet
Ⅴ. Special notes for reviews
None.