Skip to content

Commit

Permalink
Merge c6d8159 into 704420e
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaplashkin committed Jul 28, 2023
2 parents 704420e + c6d8159 commit 5c9bd16
Show file tree
Hide file tree
Showing 4 changed files with 1,369 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def module_init():

prepend_path(os.path.join(os.environ['TEST_RUN_DIR'], 'lib/luatest/bin'))

TarantoolServer.find_exe(args.builddir)
TarantoolServer.find_exe(args.builddir, executable=args.executable)
UnittestServer.find_exe(args.builddir)
AppServer.find_exe(args.builddir)
LuatestServer.find_exe(args.builddir)
Expand Down
12 changes: 12 additions & 0 deletions lib/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,18 @@ def __init__(self):
$ . <(./test/test-run.py --env)
"""))

parser.add_argument(
'--executable',
dest='executable',
default=None,
help=format_help(
"""
Set the custom path to the Tarantool executable.
It is useful if you need to test a custom build
with a different directory structure.
"""))

# XXX: We can use parser.parse_intermixed_args() on
# Python 3.7 to understand commands like
# ./test-run.py foo --exclude bar baz
Expand Down
10 changes: 3 additions & 7 deletions lib/tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,15 @@ def __init__(self, _ini=None, test_suite=None):
self.current_test = caller_globals['test_run_current_test']

@classmethod
def find_exe(cls, builddir, silent=True):
def find_exe(cls, builddir, silent=True, executable=None):
cls.builddir = os.path.abspath(builddir)
builddir = os.path.join(builddir, "src")
path = builddir + os.pathsep + os.environ["PATH"]
color_log("Looking for server binary in ", schema='serv_text')
color_log(path + ' ...\n', schema='path')
for _dir in path.split(os.pathsep):
exe = os.path.join(_dir, cls.default_tarantool["bin"])
ctl_dir = _dir
# check local tarantoolctl source
if _dir == builddir:
ctl_dir = os.path.join(_dir, '../extra/dist')

exe = executable if executable else os.path.join(_dir, cls.default_tarantool["bin"])
ctl_dir = cls.TEST_RUN_DIR
ctl = os.path.join(ctl_dir, cls.default_tarantool['ctl'])
need_lua_path = False
if os.path.isdir(ctl) or not os.access(ctl, os.X_OK):
Expand Down
Loading

0 comments on commit 5c9bd16

Please sign in to comment.