Skip to content

Commit a6112d7

Browse files
author
r.inyakin
committed
ci: fix wsl pipeline
Added the `sql_seq_scan_default` parameter to prevent the `Scanning is not allowed` error, as `SEQSCAN` behaviour changed in Tarantool 3.x. Closes #331
1 parent 5003558 commit a6112d7

4 files changed

Lines changed: 31 additions & 10 deletions

File tree

‎.github/workflows/packing.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
- name: Install tarantool
163163
shell: wsl-bash_Ubuntu-22.04 {0}
164164
run: |
165-
curl -L https://tarantool.io/release/2/installer.sh | bash -s
165+
curl -L https://tarantool.io/release/3/installer.sh | bash -s
166166
sudo apt install -y tarantool tarantool-dev
167167
168168
- name: Setup test tarantool instance

‎.github/workflows/testing.yml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ jobs:
278278
matrix:
279279
# Use reduced test matrix cause Windows pipelines are long.
280280
tarantool:
281-
# https://github.com/tarantool/tarantool-python/issues/331
282-
- '2.11.0.g247a9a418-1'
281+
- '3.3.1-1'
283282
python:
284283
- '3.11'
285284

@@ -303,10 +302,10 @@ jobs:
303302
with:
304303
distribution: Ubuntu-22.04
305304

306-
- name: Install tarantool ${{ matrix.tarantool }} for WSL (2.10 and newer)
305+
- name: Install tarantool ${{ matrix.tarantool }} for WSL
307306
shell: wsl-bash_Ubuntu-22.04 {0}
308307
run: |
309-
curl -L https://tarantool.io/release/2/installer.sh | bash -s
308+
curl -L https://tarantool.io/release/3/installer.sh | bash -s
310309
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}
311310
312311
- name: Setup test tarantool instance
@@ -348,8 +347,7 @@ jobs:
348347
matrix:
349348
# Use reduced test matrix cause Windows pipelines are long.
350349
tarantool:
351-
# https://github.com/tarantool/tarantool-python/issues/331
352-
- '2.11.0.g247a9a418-1'
350+
- '3.3.1-1'
353351
python:
354352
- '3.11'
355353
steps:
@@ -378,7 +376,7 @@ jobs:
378376
- name: Install tarantool ${{ matrix.tarantool }} for WSL
379377
shell: wsl-bash_Ubuntu-22.04 {0}
380378
run: |
381-
curl -L https://tarantool.io/release/2/installer.sh | bash -s
379+
curl -L https://tarantool.io/release/3/installer.sh | bash -s
382380
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}
383381
384382
- name: Setup test tarantool instance

‎test/suites/lib/remote_tarantool_server.py‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ class RemoteTarantoolServer():
3131
Class to work with remote Tarantool server.
3232
"""
3333

34-
def __init__(self):
34+
def __init__(self, sql_seq_scan_default=None):
3535
self.host = os.environ['REMOTE_TARANTOOL_HOST']
36+
self.sql_seq_scan_default = sql_seq_scan_default
3637

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

99+
def set_sql_seq_scan_default(self, value):
100+
"""
101+
Set compat.sql_seq_scan_default on the remote server. The
102+
option affects sessions created after the call, so it must be
103+
set before the test connects to the server.
104+
"""
105+
106+
res = self.admin.execute(f"""
107+
local is_compat, compat = pcall(require, 'compat')
108+
if is_compat then
109+
compat.sql_seq_scan_default = '{value}'
110+
end
111+
return true
112+
""")
113+
if res != [True]:
114+
raise RuntimeError(
115+
f'can not set compat.sql_seq_scan_default to "{value}": {str(res)}')
116+
98117
def start(self):
99118
"""
100119
Initialize the work with the remote server.
101120
"""
102121

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

107128
def stop(self):
@@ -110,6 +131,8 @@ def stop(self):
110131
"""
111132

112133
self.admin.execute('box.cfg{listen = box.NULL}')
134+
if self.sql_seq_scan_default is not None:
135+
self.set_sql_seq_scan_default('default')
113136
self.release_lock()
114137

115138
def is_started(self):

‎test/suites/lib/tarantool_server.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def __new__(cls,
194194
# pylint: disable=unused-argument
195195

196196
if os.name == 'nt':
197-
return RemoteTarantoolServer()
197+
return RemoteTarantoolServer(sql_seq_scan_default=sql_seq_scan_default)
198198
return super(TarantoolServer, cls).__new__(cls)
199199

200200
def __init__(self,

0 commit comments

Comments
 (0)