Skip to content

unit tests on commands #37

Closed
Closed

Description

@vdemeester

Moving initial docker/docker issue moby/moby#31217 here

This issue is to keep track of unit test for the cli (i.e. cli/commands package and sub-packages).

The swarm, node and volume packages are example on how to write those tests (but they probably can be enhance, and enhancement are always welcome ).

  • In order to write tests for these, you'll have to create more builder (cli/internal/test/builders) for objects that are not yet there.
  • You can also use golden files (see examples)
  • For each of these package, there is some integration tests (in integration-cli) that could be removed. I tried to mark them when I saw them, but it's not complete yet. I'll try to update this issue with a list of integration test that could be gone for each packages.

Activity

  1. dnephin commented on May 26, 2017

    @dnephin
    Contributor

    We may need to move some of the fakeClient into cli/internal/test/ and export the struct and fields. There are some packages (stack, and service at least) that use parts of other clients.

  2. jeremcs commented on Jun 6, 2017

    @jeremcs

    Some items on the list seem to be deprecated as they do not appear when setting the DOCKER_HIDE_LEGACY_COMMANDS variable:

    • bundlefile
    • inspect
    • prune
    • registry
    • task

    Should we remove them from the list ?

    (cc @kelu27)

  3. vdemeester commented on Jun 6, 2017

    @vdemeester
    CollaboratorAuthor

    @jeremcs I would say not (because some of them won't ever be removed).

  4. clook commented on Jun 19, 2017

    @clook

    Starting working on service (#201)

  5. adshmh commented on Jun 27, 2017

    @adshmh
    Contributor

    #dibs on task package

  6. adshmh commented on Jun 30, 2017

    @adshmh
    Contributor

    #dibs on checkpoint package.

  7. Zebrilee commented on Jul 20, 2017

    @Zebrilee
    Contributor

    hi @vdemeester ,
    I was working on prune test in the last hackergarten but I saw the commit two days ago which modify the prune.go file and add a prune_test.go too.
    I believe this part is ok or is there something else to do?

  8. vdemeester commented on Jul 20, 2017

    @vdemeester
    CollaboratorAuthor

    @Zebrilee oh right yeah, I should mark it on the issue

  9. redpanda commented on Aug 23, 2017

    @redpanda
    Contributor

    #dibs on network package.

  10. vdemeester commented on May 30, 2018

    @vdemeester
    CollaboratorAuthor

    Closing this as all those packages have some test. We can enhance the coverage but I feel this issue can be considered as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions