From c6ec2df85bf12c4e1a24d38a6f93e70464cd4b4a Mon Sep 17 00:00:00 2001 From: nvbn Date: Fri, 24 Jul 2015 23:27:04 +0300 Subject: [PATCH] #N/A Run functional tests in travis-ci --- tests/functional/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/functional/utils.py b/tests/functional/utils.py index 3a3c04ae..edb017cc 100644 --- a/tests/functional/utils.py +++ b/tests/functional/utils.py @@ -9,15 +9,16 @@ import pexpect import pytest root = str(Path(__file__).parent.parent.parent.resolve()) -docker = os.environ.get('DOCKER', 'docker').split(' ') +docker = os.environ.get('DOCKER', 'docker') def build_container(tag, dockerfile): tmpdir = mkdtemp() with Path(tmpdir).joinpath('Dockerfile').open('w') as file: file.write(dockerfile) - if subprocess.call(['docker', 'build', '--tag={}'.format(tag), tmpdir], - cwd=root) != 0: + if subprocess.call( + docker.split(' ') + ['build', '--tag={}'.format(tag), tmpdir], + cwd=root) != 0: raise Exception("Can't build a container") shutil.rmtree(tmpdir) @@ -27,7 +28,8 @@ def spawn(tag, dockerfile): tag = 'thefuck/{}'.format(tag) build_container(tag, dockerfile) proc = pexpect.spawnu( - 'docker run --volume {}:/src --tty=true --interactive=true {}'.format(root, tag)) + '{} run --volume {}:/src --tty=true --interactive=true {}'.format( + docker, root, tag)) proc.logfile = sys.stdout proc.sendline('pip install /src')