Skip to content

docker-py: skip broken ImageCollectionTest::test_pull_multiple, and re-enable fixed tests#40343

Merged
tianon merged 2 commits intomoby:masterfrom
thaJeztah:skip_broken_docker_py_test
Jan 3, 2020
Merged

docker-py: skip broken ImageCollectionTest::test_pull_multiple, and re-enable fixed tests#40343
tianon merged 2 commits intomoby:masterfrom
thaJeztah:skip_broken_docker_py_test

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

re-enable tests that were fixed:

docker/docker-py#2369, docker/docker-py#2380, and docker/docker-py#2382 are included in docker-py v4.1.0, so we can re-enable these tests

docker-py: skip broken ImageCollectionTest::test_pull_multiple

The ImageCollectionTest.test_pull_multiple test performs a docker pull without
a :tag specified) to pull all tags of the given repository (image).

After pulling the image, the image(s) pulled are checked to verify if the list
of images contains the :latest tag.

However, the test assumes that all tags of the image are tags for the same
version of the image (same digest), and thus a single image is returned, which
is not always the case.

Currently, the hello-world:latest and hello-world:linux tags point to a
different digest, therefore the client.images.pull() returns multiple images:
one image for digest, making the test fail:

=================================== FAILURES ===================================
____________________ ImageCollectionTest.test_pull_multiple ____________________
tests/integration/models_images_test.py:90: in test_pull_multiple
    assert len(images) == 1
E   AssertionError: assert 2 == 1
E    +  where 2 = len([<Image: 'hello-world:linux'>, <Image: 'hello-world:latest'>])

This patch temporarily skips the broken test until it is fixed upstream (PR: docker/docker-py#2485).

The ImageCollectionTest.test_pull_multiple test performs a `docker pull` without
a `:tag` specified) to pull all tags of the given repository (image).

After pulling the image, the image(s) pulled are checked to verify if the list
of images contains the `:latest` tag.

However, the test assumes that all tags of the image are tags for the same
version of the image (same digest), and thus a *single* image is returned, which
is not always the case.

Currently, the `hello-world:latest` and `hello-world:linux` tags point to a
different digest, therefore the `client.images.pull()` returns multiple images:
one image for digest, making the test fail:

    =================================== FAILURES ===================================
    ____________________ ImageCollectionTest.test_pull_multiple ____________________
    tests/integration/models_images_test.py:90: in test_pull_multiple
        assert len(images) == 1
    E   AssertionError: assert 2 == 1
    E    +  where 2 = len([<Image: 'hello-world:linux'>, <Image: 'hello-world:latest'>])

This patch temporarily skips the broken test until it is fixed upstream.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah requested a review from tianon as a code owner January 3, 2020 14:51
@thaJeztah thaJeztah changed the title docker-py: skip broken ImageCollectionTest::test_pull_multiple, and re-enabled fixed tests docker-py: skip broken ImageCollectionTest::test_pull_multiple, and re-enable fixed tests Jan 3, 2020
@thaJeztah
Copy link
Copy Markdown
Member Author

yay, green now

@AkihiroSuda @cpuguy83 @tianon ptal 🤗

Copy link
Copy Markdown
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants