Commit 32e206dd authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

hg: new CLI option for client-side executable

This seems to be necessary for CI tests inside the Docker
container, because /opt/gitlab/omnibus/bin is not on the PATH
of the `git` user.
parent c389a999b6ff
......@@ -12,6 +12,7 @@ COMMON_FLAGS="-v \
--heptapod-ssh-port 22 \
--heptapod-ssh-user git \
--heptapod-reverse-call-host=localhost \
--heptapod-hg-client-executable=/opt/gitlab/embedded/bin/hg \
--heptapod-omnibus"
chown -R git:git .
......
......@@ -10,6 +10,7 @@ from tests.utils import unique_name
from tests.utils.project import Project
from tests.utils.group import Group
from tests.utils.user import User
from tests.utils import hg
from tests.utils.heptapod import (
Heptapod,
OmnibusHeptapod,
......@@ -77,6 +78,11 @@ def pytest_addoption(parser):
"created from scratch and in constrained environments "
"(CI…). Without this, it can even happen that the "
"first test passes and the second fails")
parser.addoption('--heptapod-hg-client-executable',
default='hg',
help="Path to the hg executable on the client side, "
"i.e., the one used for local repos that get pulled "
"and pushed from the Heptapod server.")
def pytest_configure(config):
......@@ -138,6 +144,10 @@ def heptapod(pytestconfig):
lock.acquire()
active_threads += 1
# TODO probably cleaner to store that on the heptapod fixture,
# as we're doing for Git, but that'd probably involve lots of refactoring
hg.HG_EXECUTABLE = pytestconfig.getoption('heptapod_hg_client_executable')
url = pytestconfig.getoption('heptapod_url')
common = dict(
url=url,
......
......@@ -7,6 +7,7 @@ SHORT_TEMPLATE = (
'{rev}:{node|short} {desc|firstline} ({phase})\n'
'{if (obsfate, " obsolete:{obsfate}\n\n")}'
)
HG_EXECUTABLE = 'hg'
logger = logging.getLogger(__name__)
......@@ -21,7 +22,7 @@ def hg_call(cwd, cmd, check_return_code=True, expected_return_code=0,
of ``subprocess.check_output()``.
:param encoding: if `None`, the default encoding is used
"""
hgcmd = ['hg']
hgcmd = [HG_EXECUTABLE]
hgcmd.extend(str(s) if not isinstance(s, bytes) else s for s in cmd)
if encoding is None:
env = os.environ
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment