diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15d0694b..4d04a775 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,13 +8,13 @@ jobs: github.event.pull_request.head.repo.full_name != github.repository ) && ( github.repository == 'tarantool/test-run' ) - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - tarantool-version: ['2.8', '2.10', '2.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + tarantool-version: ['2.10', '2.11'] steps: - uses: actions/checkout@v3 @@ -31,11 +31,15 @@ jobs: python-version: ${{ matrix.python-version }} - name: display python version run: python -c "import sys; print(sys.version)" + - name: setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | sudo bash + sudo apt install -y tt + tt version - name: setup dependencies run: | - sudo apt update -y - sudo apt-get -y install lua5.1 luarocks - sudo luarocks install luacheck + tt rocks install luatest + tt rocks install luacheck - name: setup python dependencies run: | pip install -r requirements.txt diff --git a/.gitmodules b/.gitmodules index e58ad745..006735f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/.luacheckrc b/.luacheckrc index 575bfce2..6b14ac72 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -27,6 +27,5 @@ include_files = { exclude_files = { "lib/tarantool-python", "test/test-tarantool/*.test.lua", - "lib/luatest/**", - "lib/checks/**", + ".rocks/**/*.lua", } diff --git a/Makefile b/Makefile index fcd6acf7..fbc424a3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +export PATH := .rocks/bin:$(PATH) + MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) PROJECT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH))) TEST_RUN_EXTRA_PARAMS?= diff --git a/bin/luatest b/bin/luatest new file mode 100755 index 00000000..e51b98b7 --- /dev/null +++ b/bin/luatest @@ -0,0 +1,20 @@ +#!/usr/bin/env tarantool + +-- +-- Add the luatest module to LUA_PATH so that it can be used in processes +-- spawned by tests. +-- +local fio = require('fio') +local path = package.search('luatest') +if path == nil then + error('luatest not found') +end +path = fio.dirname(path) -- strip init.lua +path = fio.dirname(path) -- strip luatest +os.setenv('LUA_PATH', + path .. '/?.lua;' .. path .. '/?/init.lua;' .. + (os.getenv('LUA_PATH') or ';')) + +print(('Tarantool version is %s'):format(require('tarantool').version)) + +require('luatest.cli_entrypoint')() diff --git a/lib/__init__.py b/lib/__init__.py index 1c476095..4696fe91 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -70,18 +70,12 @@ def module_init(): 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;;' - ) - + os.environ["LUA_PATH"] = SOURCEDIR+"/?.lua;"+SOURCEDIR+"/?/init.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(os.environ['TEST_RUN_DIR'], 'bin')) TarantoolServer.find_exe(args.builddir, executable=args.executable) UnittestServer.find_exe(args.builddir) diff --git a/lib/checks b/lib/checks deleted file mode 160000 index c97888c8..00000000 --- a/lib/checks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c97888c8d4a5ffb0255267d2d82fd60bae17916a diff --git a/lib/luatest b/lib/luatest deleted file mode 160000 index b4461209..00000000 --- a/lib/luatest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b44612090a33cf7e8ea56af897ebc89e50380589 diff --git a/lib/luatest_server.py b/lib/luatest_server.py index c128b4f4..92307f66 100644 --- a/lib/luatest_server.py +++ b/lib/luatest_server.py @@ -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.environ['TEST_RUN_DIR'] + '/bin/luatest' @classmethod def verify_luatest_exe(cls):