Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@
[submodule "lib/tarantool-python"]
path = lib/tarantool-python
url = https://github.com/tarantool/tarantool-python.git
[submodule "lib/checks"]
path = lib/checks
url = https://github.com/tarantool/checks.git
[submodule "lib/luatest"]
path = lib/luatest
url = https://github.com/tarantool/luatest.git
2 changes: 0 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ include_files = {
exclude_files = {
"lib/tarantool-python",
"test/test-tarantool/*.test.lua",
"lib/luatest/**",
"lib/checks/**",
}
8 changes: 4 additions & 4 deletions lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ def module_init():
pass

args.builddir = os.path.abspath(os.path.expanduser(args.builddir))
args.luatestdir = os.path.abspath(os.path.expanduser(args.luatestdir))

SOURCEDIR = os.path.dirname(os.getcwd())
BUILDDIR = args.builddir
LUATESTDIR = args.luatestdir
os.environ["SOURCEDIR"] = SOURCEDIR
os.environ["BUILDDIR"] = BUILDDIR
soext = sys.platform == 'darwin' and 'dylib' or 'so'

os.environ['LUA_PATH'] = (
SOURCEDIR + '/?.lua;' + SOURCEDIR + '/?/init.lua;'
+ os.environ['TEST_RUN_DIR'] + '/lib/checks/?.lua;'
+ os.environ['TEST_RUN_DIR'] + '/lib/luatest/?/init.lua;'
+ os.environ['TEST_RUN_DIR'] + '/lib/luatest/?.lua;;'
+ LUATESTDIR + '/?/init.lua;' + LUATESTDIR + '/?.lua;;'
)

os.environ["LUA_CPATH"] = BUILDDIR+"/?."+soext+";;"
os.environ["REPLICATION_SYNC_TIMEOUT"] = str(args.replication_sync_timeout)
os.environ['MEMTX_ALLOCATOR'] = args.memtx_allocator

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

TarantoolServer.find_exe(args.builddir, executable=args.executable)
UnittestServer.find_exe(args.builddir)
Expand Down
1 change: 0 additions & 1 deletion lib/checks
Submodule checks deleted from c97888
1 change: 0 additions & 1 deletion lib/luatest
Submodule luatest deleted from b44612
2 changes: 1 addition & 1 deletion lib/luatest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def find_exe(cls, builddir):
cls.binary = TarantoolServer.binary
cls.debug = bool(re.findall(r'^Target:.*-Debug$', str(cls.version()),
re.M))
cls.luatest = os.environ['TEST_RUN_DIR'] + '/lib/luatest/bin/luatest'
cls.luatest = os.path.join(Options().args.luatestdir, 'bin/luatest')

@classmethod
def verify_luatest_exe(cls):
Expand Down
15 changes: 15 additions & 0 deletions lib/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,21 @@ def __init__(self):
Default: false.
"""))

parser.add_argument(
"--luatestdir",
dest="luatestdir",
default="../third_party/luatest",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we search it using LUA_PATH by default?

I mean, we don't need the bin/luatest wrapper (it just makes things more complicated for us in the case), we can just do tarantool -e 'require('luatest.cli_entrypoint')()'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we don't ever need this --luatestdir argument or env variable. Just correctly configured lua paths.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is I don't want to setup LUA_PATH when running tests in Tarantool with test-run.py. I just want everything to work by default, without any extra parameters or environment variables. Moreover, I'd like test-run.py --env to setup LUA_PATH so that I can run tests with luatest.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, yes, we could require developers to setup luatest by themselves for running Tarantool tests, but (a) this would be inconvenient and (b) could result in non-obvious errors caused by using an old version of luatest. Better checkout luatest as a submodule in Tarantool and make test-run use it automatically IMO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #455.

help=format_help(
"""
Path to luatest directory.

Beware: A relative path is resolved against the directory,
where all tests reside. **NOT** a current directory of a
parent shell.

Default: ../third_party/luatest
"""))

parser.add_argument(
"--builddir",
dest="builddir",
Expand Down