Skip to content

Commit

Permalink
Merge branch 'master' into update_docker_version
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Barra committed Feb 10, 2018
2 parents 2b10448 + 726643b commit e322634
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
17 changes: 1 addition & 16 deletions tests/conftest.py
Expand Up @@ -15,9 +15,6 @@
"17.10": "v1.33",
"17.09": "v1.32",
"17.06": "v1.30",
"17.05": "v1.29",
"17.04": "v1.28",
"17.03": "v1.27",
}


Expand Down Expand Up @@ -105,21 +102,9 @@ def check(version, reason):

@pytest.fixture
def swarm(event_loop, docker):
if StrictVersion(docker.api_version[1:]) < StrictVersion("1.28"):
pytest.skip("The feature is experimental before API version 1.28")
assert event_loop.run_until_complete(docker.swarm.init())
yield docker
try:
assert event_loop.run_until_complete(docker.swarm.leave(force=True))
except DockerError as exc:
if StrictVersion(docker.api_version[1:]) >= StrictVersion("1.30"):
raise
else:
# NOTE: in Docker version 1.28 and 1.29, it is possible that Docker
# refuses to leave the Swarm cleanly. Reducing the number
# of service ran seems to solve the issue. More at #53
assert event_loop.run_until_complete(
docker.swarm.leave(force=True))
assert event_loop.run_until_complete(docker.swarm.leave(force=True))


@pytest.fixture
Expand Down
4 changes: 0 additions & 4 deletions tests/test_integration.py
Expand Up @@ -5,7 +5,6 @@
import sys
import tarfile
import time
from distutils.version import StrictVersion

import aiohttp
import pytest
Expand Down Expand Up @@ -105,9 +104,6 @@ async def test_container_lifecycles(docker, testing_images):
@pytest.mark.skipif(sys.platform == 'darwin',
reason="Docker for Mac has a bug with websocket")
async def test_stdio_stdin(docker, testing_images, shell_container):
if StrictVersion(docker.api_version[1:]) < StrictVersion("1.28"):
pytest.skip("The WebSocket return text before API version 1.28")

# echo of the input.
ws = await shell_container.websocket(stdin=True, stdout=True, stream=True)
await ws.send_str('echo hello world\n')
Expand Down
7 changes: 0 additions & 7 deletions tests/test_services.py
@@ -1,7 +1,6 @@
import aiohttp
import asyncio
import pytest
from distutils.version import StrictVersion


TaskTemplate = {
Expand Down Expand Up @@ -50,9 +49,6 @@ async def test_service_tasks(swarm, tmp_service):

@pytest.mark.asyncio
async def test_logs_services(swarm):
if StrictVersion(swarm.api_version[1:]) < StrictVersion("1.29"):
pytest.skip("The feature is experimental before API version 1.29")

TaskTemplate = {
"ContainerSpec": {
"Image": "python:3.6.1-alpine",
Expand Down Expand Up @@ -91,9 +87,6 @@ async def test_logs_services(swarm):

@pytest.mark.asyncio
async def test_logs_services_stream(swarm):
if StrictVersion(swarm.api_version[1:]) < StrictVersion("1.29"):
pytest.skip("The feature is experimental before API version 1.29")

TaskTemplate = {
"ContainerSpec": {
"Image": "python:3.6.1-alpine",
Expand Down

0 comments on commit e322634

Please sign in to comment.