mirror of https://github.com/docker/docker-py.git
Run unit tests in a container with no .docker/config mount
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
6de6936f5d
commit
00da4dc0ea
|
|
@ -85,6 +85,13 @@ def runTests = { Map settings ->
|
||||||
def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
|
def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
|
||||||
withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') {
|
withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') {
|
||||||
try {
|
try {
|
||||||
|
// unit tests
|
||||||
|
sh """docker run --rm \\
|
||||||
|
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
|
||||||
|
${testImage} \\
|
||||||
|
py.test -v -rxs --cov=docker tests/unit
|
||||||
|
"""
|
||||||
|
// integration tests
|
||||||
sh """docker network create ${testNetwork}"""
|
sh """docker network create ${testNetwork}"""
|
||||||
sh """docker run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\
|
sh """docker run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\
|
||||||
${imageDindSSH} dockerd -H tcp://0.0.0.0:2375
|
${imageDindSSH} dockerd -H tcp://0.0.0.0:2375
|
||||||
|
|
@ -97,7 +104,7 @@ def runTests = { Map settings ->
|
||||||
--volumes-from ${dindContainerName} \\
|
--volumes-from ${dindContainerName} \\
|
||||||
-v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\
|
-v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\
|
||||||
${testImage} \\
|
${testImage} \\
|
||||||
py.test -v -rxs --cov=docker --ignore=tests/ssh tests/
|
py.test -v -rxs --cov=docker tests/integration
|
||||||
"""
|
"""
|
||||||
sh """docker stop ${dindContainerName}"""
|
sh """docker stop ${dindContainerName}"""
|
||||||
// start DIND container with SSH
|
// start DIND container with SSH
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue