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

Add the testing for docker package #18

Merged
merged 2 commits into from
Jun 5, 2018
Merged

Conversation

hwchiu
Copy link
Contributor

@hwchiu hwchiu commented Jun 5, 2018

  • Add the testing for docker
  • You should install the docker in your local environment
  • Pull out the client out of the docker package

@hwchiu hwchiu requested review from chenyunchen and John-Lin June 5, 2018 10:13
@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

Merging #18 into master will increase coverage by 5.36%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   79.67%   85.03%   +5.36%     
==========================================
  Files           5        5              
  Lines         123      127       +4     
==========================================
+ Hits           98      108      +10     
+ Misses         18       12       -6     
  Partials        7        7
Impacted Files Coverage Δ
docker/docker.go 75% <83.33%> (+58.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9850b4...5f66539. Read the comment docs.

@@ -29,3 +34,40 @@ func TestGetSandboxKey(t *testing.T) {
netnsPath := GetSandboxKey(containerInfo)
assert.Equal(t, "/var/run/docker/netns/66d0d6831275", netnsPath)
}

func TestListContainer(t *testing.T) {
cli, err := client.NewEnvClient()
Copy link

Choose a reason for hiding this comment

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

I think you can use composition:

type Client struct {
    dockercli.Client
    Context *context.Context
}

@John-Lin John-Lin merged commit 0676e2f into master Jun 5, 2018
@John-Lin John-Lin deleted the hwchiu/fix-docker-test branch June 7, 2018 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants