Tox uses python3 to setup virtualenv
I am trying to run the e2e tests locally with gitlab-runner but it fails:
--- git/bitmask-dev ‹master* M⁇› » gitlab-runner exec docker --docker-privileged --env BITMASK_INVITE_CODE="$BITMASK_INVITE_CODE" --env TEST_PASSWORD="$TEST_PASSWORD" --env TEST_USERNAME="$TEST_USERNAME" e2e_tests
WARNING: Since GitLab Runner 10.0 this command is marked as DEPRECATED and will be removed in one of upcoming releases
WARNING: You most probably have uncommitted changes.
WARNING: These changes will not be tested.
Running with gitlab-runner 10.1.0 (c1ecf97f)
on ()
Using Docker executor with image 0xacab.org:4567/leap/bitmask-dev:latest ...
Using docker image sha256:e8b05efb69792231956c2ecaa30178353800a829b5fd47d2d31ecf211e802f67 for predefined container...
Pulling docker image 0xacab.org:4567/leap/bitmask-dev:latest ...
Using docker image 0xacab.org:4567/leap/bitmask-dev:latest ID=sha256:79a3815b2b46e423beddb95e4beeb565ad6096805f4a4c9965fa7f43e403881e for build container...
Running on runner--project-0-concurrent-0 via rocinante...
Cloning repository...
Cloning into '/builds/project-0'...
done.
Checking out 7622e66f as master...
Skipping Git submodules setup
$ dpkg -l tox > /dev/null || apt-get -y --no-install-recommends install tox
$ tox -e py27-dev --notest
py27-dev create: /builds/project-0/.tox/py27-dev
ERROR: invocation failed (exit code 1), logfile: /builds/project-0/.tox/py27-dev/log/py27-dev-0.log
ERROR: actionid: py27-dev
msg: getenv
cmdargs: ['/usr/bin/python3', '-m', 'virtualenv', '--python', '/usr/bin/python2.7', 'py27-dev']
env: {'DOCKER_DRIVER': 'overlay', 'CI_JOB_TOKEN': '', 'CI_JOB_NAME': 'e2e_tests', 'CI_SERVER_VERSION': '', 'LANG': 'en_US.utf8', 'GITLAB_CI': 'true', 'CI_SERVER_REVISION': '', 'TEST_USERNAME': 'testuser1@demo.bitmask.net', 'HOSTNAME': 'runner--project-0-concurrent-0', 'OLDPWD': '/tmp', 'CI_DISPOSABLE_ENVIRONMENT': 'true', 'TEST_PASSWORD': 'Rvhi6z3sbJIyL/JO7', 'CI_SERVER_NAME': 'GitLab CI', 'CI': 'true', 'CI_PROJECT_ID': '0', 'PWD': '/builds/project-0', 'HOME': '/tmp', 'CI_COMMIT_BEFORE_SHA': '99700bb2ff808784bf227a5ce000fe833fc99617', 'DEBIAN_FRONTEND': 'noninteractive', 'CI_COMMIT_REF_NAME': 'master', 'CI_SERVER': 'yes', 'CI_JOB_ID': '1', 'CI_REPOSITORY_URL': '/home/varac/leap/git/bitmask-dev', 'BITMASK_INVITE_CODE': 'rjfp-jpnx', 'SHLVL': '1', 'CI_COMMIT_REF': '7622e66fd31f3d23d36186e357e9bf95c459fdda', 'PATH': '/builds/project-0/.tox/py27-dev/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'CI_PROJECT_DIR': '/builds/project-0', 'CI_JOB_STAGE': 'e2e', '_': '/usr/bin/tox', 'CPPFLAGS': "'-I/usr/local/include/sqlcipher'", 'LDFLAGS': "'-L/usr/local/lib'", 'PYTHONHASHSEED': '1015584748', 'VIRTUAL_ENV': '/builds/project-0/.tox/py27-dev'}
New python executable in /builds/project-0/.tox/py27-dev/bin/python2.7
Also creating executable in /builds/project-0/.tox/py27-dev/bin/python
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /builds/project-0/.tox/py27-dev/bin/python2.7 - setuptools pkg_resources pip wheel:
Collecting setuptools
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/builds/project-0/.tox/py27-dev/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/builds/project-0/.tox/py27-dev/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/builds/project-0/.tox/py27-dev/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/builds/project-0/.tox/py27-dev/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/builds/project-0/.tox/py27-dev/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/builds/project-0/.tox/py27-dev/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/builds/project-0/.tox/py27-dev/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
----------------------------------------
...Installing setuptools, pkg_resources, pip, wheel...done.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 992, in create_environment
download=download,
File "/usr/lib/python3/dist-packages/virtualenv.py", line 922, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 817, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /builds/project-0/.tox/py27-dev/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
Running virtualenv with interpreter /usr/bin/python2.7
ERROR: InvocationError: /usr/bin/python3 -m virtualenv --python /usr/bin/python2.7 py27-dev (see /builds/project-0/.tox/py27-dev/log/py27-dev-0.log)
___________________________________ summary ____________________________________
ERROR: py27-dev: InvocationError: /usr/bin/python3 -m virtualenv --python /usr/bin/python2.7 py27-dev (see /builds/project-0/.tox/py27-dev/log/py27-dev-0.log)
Running after script...
ERROR: Job failed: exit code 1
FATAL: exit code 1
Tox uses python3 to create the virtualenv like this:
ERROR: py27-dev: InvocationError: /usr/bin/python3 -m virtualenv --python /usr/bin/python2.7 py27-dev (see /builds/project-0/.tox/py27-dev/log/py27-dev-0.log)
So either tox needs to use python2 or the test setup needs to get python3 compliant. Don't know how to do this unfortunatly.