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

Sort services names in a natural order #357

Merged
merged 1 commit into from
Jul 20, 2017
Merged

Sort services names in a natural order #357

merged 1 commit into from
Jul 20, 2017

Conversation

boaz0
Copy link
Contributor

@boaz0 boaz0 commented Jul 19, 2017

Follow-up to #315

@aaronlehmann Let me know if there are other resources that need to be natural-sorted.

- What I did

Use natural sorting to display swarm services

- How I did it

Using the sortorder.NaturalLess function and the Sort interface

- How to verify it

$ TESTDIR='cli/command/service' go test -v

@codecov-io
Copy link

codecov-io commented Jul 19, 2017

Codecov Report

Merging #357 into master will increase coverage by 0.31%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
+ Coverage   45.47%   45.78%   +0.31%     
==========================================
  Files         193      193              
  Lines       16061    16065       +4     
==========================================
+ Hits         7304     7356      +52     
+ Misses       8379     8323      -56     
- Partials      378      386       +8

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/pkg/testutil"
"github.com/moby/moby/pkg/testutil/golden"
Copy link
Contributor

Choose a reason for hiding this comment

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

docker/docker/pkg/testutil/golden


func TestServiceListOrder(t *testing.T) {
buf := new(bytes.Buffer)
cli := test.NewFakeCliWithOutput(&fakeClient{
Copy link
Contributor

Choose a reason for hiding this comment

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

NewFakeCliWithOutput is deprecated. Please use NewFakeCli(). It defaults to an output buffer.

You can get the buffer from cli.OutBuffer()

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
@aaronlehmann
Copy link
Contributor

LGTM

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit dfbad2b into docker:master Jul 20, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.07.0 milestone Jul 20, 2017
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.

7 participants