Skip to content
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

Make volume ls output order #20389

Merged
merged 1 commit into from
Feb 19, 2016
Merged

Conversation

HackToday
Copy link
Contributor

Fixes: #20384
Add order support for volume ls to make it easy
to external users to consume.

Signed-off-by: Kai Qiang Wu(Kennan) wkqwu@cn.ibm.com

Fixes: moby#20384
Add order support for volume ls to make it easy
to external users to consume.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
// Since there is no guarantee of ordering of volumes, we just make sure the names are in the output
c.Assert(strings.Contains(out, id+"\n"), check.Equals, true)
c.Assert(strings.Contains(out, "test\n"), check.Equals, true)
assertVolList(c, out, []string{"aaa", "soo", "test"})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be 100% sure that no other volumes exist from other tests? Just wondering if there's a chance another volume gets into the list, making the test become flaky

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @thaJeztah right now, I did not find the good reason the volumes left there, it means other test not good deal with clean up. So it seems if it happen, it means other tests not good written.

Wdyt? If we can not assume others test good written. what do you think the best way to test the sort behavior ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that;

  1. In this case perhaps assertVolList can skip volumes that are not in the list of expectedVols? Alternatively, only check if they are all present, and appear the expected order
  2. We should make sure that (just as with containers) all volumes are removed after a test completes (but that can be a separate PR)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a volume is left in the list, then there is a bug somewhere since we clean up all volumes on every test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So @thaJeztah @cpuguy83 seems the above "left volume" issue is not related with this PR. as all other tests follow same logic it depends on

func (s *DockerSuite) TearDownTest(c *check.C) {
unpauseAllContainers()
deleteAllContainers()
deleteAllImages()
deleteAllVolumes()
deleteAllNetworks()
}

That DockerSuite would did that, I think, we not need to call delete volume in single test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; if the TearDown removes all volumes, individual tests should not call delete volume

@cpuguy83
Copy link
Member

Just to have the discussion... should this also be grouped by driver?

@thaJeztah
Copy link
Member

Just to have the discussion... should this also be grouped by driver?

Not for now, I think; we don't currently group, e.g., containers per "image" used? Being able to --filter driver=foo would be nice though.

@HackToday
Copy link
Contributor Author

Yes, I agree with @thaJeztah for related group behavior, we need use filter ways, instead of depend the ls output behavior

@HackToday
Copy link
Contributor Author

ping @thaJeztah and @cpuguy83

Could you check above comments for the test ? Thanks

@vdemeester
Copy link
Member

@cpuguy83 agreed with @thaJeztah. Let's keep it simple for now and not group by driver. Adding a driver filter and/or sorting options (for volume but also for other docker citizens — images, containers, …) could be done after 👼

@cpuguy83
Copy link
Member

We should keep this consistent with the network ls sorting.

@HackToday
Copy link
Contributor Author

@cpuguy83 network in under review, it use same logic sort with name

@HackToday
Copy link
Contributor Author

network is here #20383

@calavera
Copy link
Contributor

LGTM

1 similar comment
@cpuguy83
Copy link
Member

LGTM

cpuguy83 added a commit that referenced this pull request Feb 19, 2016
@cpuguy83 cpuguy83 merged commit 4870188 into moby:master Feb 19, 2016
@thaJeztah thaJeztah added this to the 1.11.0 milestone Feb 19, 2016
@HackToday HackToday deleted the addvolumesupport branch February 26, 2016 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants