diff options
author | aiordache <anca.iordache@docker.com> | 2021-02-11 19:58:35 +0100 |
---|---|---|
committer | aiordache <anca.iordache@docker.com> | 2021-02-15 15:44:29 +0100 |
commit | 50af8c8b016a5ced665950f5a7b0368355119736 (patch) | |
tree | 1d249d69fea78f9480e8accd2f7eddb69a0401c7 | |
parent | e7bdfe64b72e1b26a825d4fd5f4494f8544c49dc (diff) | |
download | docker-py-50af8c8b016a5ced665950f5a7b0368355119736.tar.gz |
Run unit tests in a container with no .docker/config mount
Signed-off-by: aiordache <anca.iordache@docker.com>
-rw-r--r-- | Jenkinsfile | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index b85598f..471072b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -85,6 +85,13 @@ def runTests = { Map settings -> def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}" withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') { 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 run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\ ${imageDindSSH} dockerd -H tcp://0.0.0.0:2375 @@ -97,7 +104,7 @@ def runTests = { Map settings -> --volumes-from ${dindContainerName} \\ -v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\ ${testImage} \\ - py.test -v -rxs --cov=docker --ignore=tests/ssh tests/ + py.test -v -rxs --cov=docker tests/integration """ sh """docker stop ${dindContainerName}""" // start DIND container with SSH |