Skip to content

Commit 00da4dc

Browse files
author
aiordache
committed
Run unit tests in a container with no .docker/config mount
Signed-off-by: aiordache <[email protected]>
1 parent 6de6936 commit 00da4dc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Jenkinsfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ def runTests = { Map settings ->
8585
def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
8686
withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') {
8787
try {
88+
// unit tests
89+
sh """docker run --rm \\
90+
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
91+
${testImage} \\
92+
py.test -v -rxs --cov=docker tests/unit
93+
"""
94+
// integration tests
8895
sh """docker network create ${testNetwork}"""
8996
sh """docker run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\
9097
${imageDindSSH} dockerd -H tcp://0.0.0.0:2375
@@ -97,7 +104,7 @@ def runTests = { Map settings ->
97104
--volumes-from ${dindContainerName} \\
98105
-v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\
99106
${testImage} \\
100-
py.test -v -rxs --cov=docker --ignore=tests/ssh tests/
107+
py.test -v -rxs --cov=docker tests/integration
101108
"""
102109
sh """docker stop ${dindContainerName}"""
103110
// start DIND container with SSH

0 commit comments

Comments
 (0)