Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
007ab677
Kaydet (Commit)
007ab677
authored
May 10, 2017
tarafından
Joffrey F
Kaydeden (comit)
GitHub
May 10, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1599 from docker/test_17.05_engine
Adjust tests and add newest engine version to Jenkinsfile
üst
2bdaf7f8
6ed0c010
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
17 deletions
+37
-17
Jenkinsfile
Jenkinsfile
+2
-2
Makefile
Makefile
+2
-2
helpers.py
tests/helpers.py
+17
-7
api_service_test.py
tests/integration/api_service_test.py
+16
-6
No files found.
Jenkinsfile
Dosyayı görüntüle @
007ab677
...
@@ -7,7 +7,7 @@ def images = [:]
...
@@ -7,7 +7,7 @@ def images = [:]
// Note: Swarm in dind seem notoriously flimsy with 1.12.1+, which is why we're
// Note: Swarm in dind seem notoriously flimsy with 1.12.1+, which is why we're
// sticking with 1.12.0 for the 1.12 series
// sticking with 1.12.0 for the 1.12 series
def
dockerVersions
=
[
"1.12.0"
,
"1.13.1"
,
"17.04.0-ce
-rc1
"
]
def
dockerVersions
=
[
"1.12.0"
,
"1.13.1"
,
"17.04.0-ce
"
,
"17.05.0-ce
"
]
def
buildImage
=
{
name
,
buildargs
,
pyTag
->
def
buildImage
=
{
name
,
buildargs
,
pyTag
->
img
=
docker
.
image
(
name
)
img
=
docker
.
image
(
name
)
...
@@ -35,7 +35,7 @@ def buildImages = { ->
...
@@ -35,7 +35,7 @@ def buildImages = { ->
}
}
def
getAPIVersion
=
{
engineVersion
->
def
getAPIVersion
=
{
engineVersion
->
def
versionMap
=
[
'1.12.'
:
'1.24'
,
'1.13.'
:
'1.26'
,
'17.04'
:
'1.27'
]
def
versionMap
=
[
'1.12.'
:
'1.24'
,
'1.13.'
:
'1.26'
,
'17.04'
:
'1.27'
,
'17.05'
:
'1.29'
]
return
versionMap
[
engineVersion
.
substring
(
0
,
5
)]
return
versionMap
[
engineVersion
.
substring
(
0
,
5
)]
}
}
...
...
Makefile
Dosyayı görüntüle @
007ab677
...
@@ -41,8 +41,8 @@ integration-test: build
...
@@ -41,8 +41,8 @@ integration-test: build
integration-test-py3
:
build-py3
integration-test-py3
:
build-py3
docker run
--rm
-v
/var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/
${
file
}
docker run
--rm
-v
/var/run/docker.sock:/var/run/docker.sock docker-sdk-python3 py.test tests/integration/
${
file
}
TEST_API_VERSION
?=
1.2
7
TEST_API_VERSION
?=
1.2
9
TEST_ENGINE_VERSION
?=
17.0
4.0-ce-rc1
TEST_ENGINE_VERSION
?=
17.0
5.0-ce
.PHONY
:
integration-dind
.PHONY
:
integration-dind
integration-dind
:
build build-py3
integration-dind
:
build build-py3
...
...
tests/helpers.py
Dosyayı görüntüle @
007ab677
...
@@ -54,13 +54,23 @@ def requires_api_version(version):
...
@@ -54,13 +54,23 @@ def requires_api_version(version):
)
)
def
requires_experimental
(
f
):
def
requires_experimental
(
until
=
None
):
@functools.wraps
(
f
)
test_version
=
os
.
environ
.
get
(
def
wrapped
(
self
,
*
args
,
**
kwargs
):
'DOCKER_TEST_API_VERSION'
,
docker
.
constants
.
DEFAULT_DOCKER_API_VERSION
if
not
self
.
client
.
info
()[
'ExperimentalBuild'
]:
)
pytest
.
skip
(
'Feature requires Docker Engine experimental mode'
)
return
f
(
self
,
*
args
,
**
kwargs
)
def
req_exp
(
f
):
return
wrapped
@functools.wraps
(
f
)
def
wrapped
(
self
,
*
args
,
**
kwargs
):
if
not
self
.
client
.
info
()[
'ExperimentalBuild'
]:
pytest
.
skip
(
'Feature requires Docker Engine experimental mode'
)
return
f
(
self
,
*
args
,
**
kwargs
)
if
until
and
docker
.
utils
.
version_gte
(
test_version
,
until
):
return
f
return
wrapped
return
req_exp
def
wait_on_condition
(
condition
,
delay
=
0.1
,
timeout
=
40
):
def
wait_on_condition
(
condition
,
delay
=
0.1
,
timeout
=
40
):
...
...
tests/integration/api_service_test.py
Dosyayı görüntüle @
007ab677
...
@@ -103,18 +103,28 @@ class ServiceTest(BaseAPIIntegrationTest):
...
@@ -103,18 +103,28 @@ class ServiceTest(BaseAPIIntegrationTest):
assert
services
[
0
][
'ID'
]
==
svc_id
[
'ID'
]
assert
services
[
0
][
'ID'
]
==
svc_id
[
'ID'
]
@requires_api_version
(
'1.25'
)
@requires_api_version
(
'1.25'
)
@requires_experimental
@requires_experimental
(
until
=
'1.29'
)
def
test_service_logs
(
self
):
def
test_service_logs
(
self
):
name
,
svc_id
=
self
.
create_simple_service
()
name
,
svc_id
=
self
.
create_simple_service
()
assert
self
.
get_service_container
(
name
,
include_stopped
=
True
)
assert
self
.
get_service_container
(
name
,
include_stopped
=
True
)
logs
=
self
.
client
.
service_logs
(
svc_id
,
stdout
=
True
,
is_tty
=
False
)
attempts
=
20
log_line
=
next
(
logs
)
while
True
:
if
attempts
==
0
:
self
.
fail
(
'No service logs produced by endpoint'
)
return
logs
=
self
.
client
.
service_logs
(
svc_id
,
stdout
=
True
,
is_tty
=
False
)
try
:
log_line
=
next
(
logs
)
except
StopIteration
:
attempts
-=
1
time
.
sleep
(
0.1
)
continue
else
:
break
if
six
.
PY3
:
if
six
.
PY3
:
log_line
=
log_line
.
decode
(
'utf-8'
)
log_line
=
log_line
.
decode
(
'utf-8'
)
assert
'hello
\n
'
in
log_line
assert
'hello
\n
'
in
log_line
assert
'com.docker.swarm.service.id={}'
.
format
(
svc_id
[
'ID'
]
)
in
log_line
def
test_create_service_custom_log_driver
(
self
):
def
test_create_service_custom_log_driver
(
self
):
container_spec
=
docker
.
types
.
ContainerSpec
(
container_spec
=
docker
.
types
.
ContainerSpec
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment