Skip to content

Commit 03f54f4

Browse files
committed
Merge pull request #760 from docker/ci-fixes
CI fixes (wip)
2 parents cfbc967 + b1c2475 commit 03f54f4

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ integration-test-py3: build-py3
2828
docker run -v `$(HOST_TMPDIR)`:/tmp -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test -rxs tests/integration_test.py
2929

3030
integration-dind: build build-py3
31-
docker build -t dpy-tests -f ./tests/Dockerfile .
3231
docker run -d --name dpy-dind -v /tmp --privileged dockerswarm/dind:1.8.1 docker -d -H tcp://0.0.0.0:2375
3332
docker run --volumes-from dpy-dind --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py py.test -rxs tests/integration_test.py
3433
docker run --volumes-from dpy-dind --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py3 py.test -rxs tests/integration_test.py

tests/integration_test.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def setUp(self):
8282
if six.PY2:
8383
self.assertRegex = self.assertRegexpMatches
8484
self.assertCountEqual = self.assertItemsEqual
85-
self.client = docker_client(timeout=5)
85+
self.client = docker_client(timeout=60)
8686
self.tmp_imgs = []
8787
self.tmp_containers = []
8888
self.tmp_folders = []
@@ -1115,38 +1115,36 @@ def runTest(self):
11151115

11161116
class TestPull(BaseTestCase):
11171117
def runTest(self):
1118-
self.client.close()
1119-
self.client = docker_client(timeout=10)
11201118
try:
1121-
self.client.remove_image('busybox')
1119+
self.client.remove_image('hello-world')
11221120
except docker.errors.APIError:
11231121
pass
1124-
res = self.client.pull('busybox')
1122+
res = self.client.pull('hello-world')
1123+
self.tmp_imgs.append('hello-world')
11251124
self.assertEqual(type(res), six.text_type)
11261125
self.assertGreaterEqual(
1127-
len(self.client.images('busybox')), 1
1126+
len(self.client.images('hello-world')), 1
11281127
)
1129-
img_info = self.client.inspect_image('busybox')
1128+
img_info = self.client.inspect_image('hello-world')
11301129
self.assertIn('Id', img_info)
11311130

11321131

11331132
class TestPullStream(BaseTestCase):
11341133
def runTest(self):
1135-
self.client.close()
1136-
self.client = docker_client(timeout=10)
11371134
try:
1138-
self.client.remove_image('busybox')
1135+
self.client.remove_image('hello-world')
11391136
except docker.errors.APIError:
11401137
pass
1141-
stream = self.client.pull('busybox', stream=True)
1138+
stream = self.client.pull('hello-world', stream=True)
1139+
self.tmp_imgs.append('hello-world')
11421140
for chunk in stream:
11431141
if six.PY3:
11441142
chunk = chunk.decode('utf-8')
11451143
json.loads(chunk) # ensure chunk is a single, valid JSON blob
11461144
self.assertGreaterEqual(
1147-
len(self.client.images('busybox')), 1
1145+
len(self.client.images('hello-world')), 1
11481146
)
1149-
img_info = self.client.inspect_image('busybox')
1147+
img_info = self.client.inspect_image('hello-world')
11501148
self.assertIn('Id', img_info)
11511149

11521150

@@ -1195,9 +1193,7 @@ def runTest(self):
11951193
class ImportTestCase(BaseTestCase):
11961194
'''Base class for `docker import` test cases.'''
11971195

1198-
# Use a large file size to increase the chance of triggering any
1199-
# MemoryError exceptions we might hit.
1200-
TAR_SIZE = 512 * 1024 * 1024
1196+
TAR_SIZE = 512 * 1024
12011197

12021198
def write_dummy_tar_content(self, n_bytes, tar_fd):
12031199
def extend_file(f, n_bytes):

0 commit comments

Comments
 (0)