Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/packing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Install tarantool
shell: wsl-bash_Ubuntu-22.04 {0}
run: |
curl -L https://tarantool.io/release/2/installer.sh | bash -s
curl -L https://tarantool.io/release/3/installer.sh | bash -s
sudo apt install -y tarantool tarantool-dev

- name: Setup test tarantool instance
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ jobs:
matrix:
# Use reduced test matrix cause Windows pipelines are long.
tarantool:
# https://github.com/tarantool/tarantool-python/issues/331
- '2.11.0.g247a9a418-1'
- '3.3.1-1'
python:
- '3.11'

Expand All @@ -303,10 +302,10 @@ jobs:
with:
distribution: Ubuntu-22.04

- name: Install tarantool ${{ matrix.tarantool }} for WSL (2.10 and newer)
- name: Install tarantool ${{ matrix.tarantool }} for WSL
shell: wsl-bash_Ubuntu-22.04 {0}
run: |
curl -L https://tarantool.io/release/2/installer.sh | bash -s
curl -L https://tarantool.io/release/3/installer.sh | bash -s
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}

- name: Setup test tarantool instance
Expand Down Expand Up @@ -348,8 +347,7 @@ jobs:
matrix:
# Use reduced test matrix cause Windows pipelines are long.
tarantool:
# https://github.com/tarantool/tarantool-python/issues/331
- '2.11.0.g247a9a418-1'
- '3.3.1-1'
python:
- '3.11'
steps:
Expand Down Expand Up @@ -378,7 +376,7 @@ jobs:
- name: Install tarantool ${{ matrix.tarantool }} for WSL
shell: wsl-bash_Ubuntu-22.04 {0}
run: |
curl -L https://tarantool.io/release/2/installer.sh | bash -s
curl -L https://tarantool.io/release/3/installer.sh | bash -s
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}

- name: Setup test tarantool instance
Expand Down
25 changes: 24 additions & 1 deletion test/suites/lib/remote_tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class RemoteTarantoolServer():
Class to work with remote Tarantool server.
"""

def __init__(self):
def __init__(self, sql_seq_scan_default=None):
self.host = os.environ['REMOTE_TARANTOOL_HOST']
self.sql_seq_scan_default = sql_seq_scan_default

self.args = {}
self.args['primary'] = BINARY_PORT
Expand Down Expand Up @@ -95,13 +96,33 @@ def release_lock(self):
raise RuntimeError(f'can not release "{self.whoami}" lock: {str(err)}')
self.lock_is_acquired = False

def set_sql_seq_scan_default(self, value):
"""
Set compat.sql_seq_scan_default on the remote server. The
option affects sessions created after the call, so it must be
set before the test connects to the server.
"""

res = self.admin.execute(f"""
local is_compat, compat = pcall(require, 'compat')
if is_compat then
compat.sql_seq_scan_default = '{value}'
end
return true
""")
if res != [True]:
raise RuntimeError(
f'can not set compat.sql_seq_scan_default to "{value}": {str(res)}')

def start(self):
"""
Initialize the work with the remote server.
"""

if not self.lock_is_acquired:
self.acquire_lock()
if self.sql_seq_scan_default is not None:
self.set_sql_seq_scan_default(self.sql_seq_scan_default)
self.admin.execute(f'box.cfg{{listen = "0.0.0.0:{self.args["primary"]}"}}')

def stop(self):
Expand All @@ -110,6 +131,8 @@ def stop(self):
"""

self.admin.execute('box.cfg{listen = box.NULL}')
if self.sql_seq_scan_default is not None:
self.set_sql_seq_scan_default('default')
self.release_lock()

def is_started(self):
Expand Down
2 changes: 1 addition & 1 deletion test/suites/lib/tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def __new__(cls,
# pylint: disable=unused-argument

if os.name == 'nt':
return RemoteTarantoolServer()
return RemoteTarantoolServer(sql_seq_scan_default=sql_seq_scan_default)
return super(TarantoolServer, cls).__new__(cls)

def __init__(self,
Expand Down
Loading