File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 51
51
when a server fails to start due to bad configuration.
52
52
- Save server artifacts (logs, snapshots, etc.) if the test fails.
53
53
- Group working directories of servers inside a replica set into one directory.
54
+ - Fix collecting coverage if tarantool binary has a suffix.
54
55
55
56
## 0.5.7
56
57
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ function Server:initialize()
169
169
table.insert (self .args , 3 , self .command )
170
170
self .command = arg [- 1 ]
171
171
-- If command is tarantool, add `-l luatest.coverage`
172
- elseif self .command : endswith ( ' /tarantool ' ) then
172
+ elseif utils . is_tarantool_binary ( self .command ) then
173
173
if not fun .index (' luatest.coverage' , self .args ) then
174
174
table.insert (self .args , 1 , ' -l' )
175
175
table.insert (self .args , 2 , ' luatest.coverage' )
@@ -248,7 +248,7 @@ function Server:start(opts)
248
248
local args = table .copy (self .args )
249
249
local env = table .copy (os .environ ())
250
250
251
- if not command : endswith ( ' /tarantool ' ) then
251
+ if not utils . is_tarantool_binary ( self . command ) then
252
252
-- When luatest is installed as a rock, the internal server_instance.lua
253
253
-- script won't have execution permissions even though it has them in the
254
254
-- source tree, and won't be able to be run while a server start. To bypass
Original file line number Diff line number Diff line change @@ -182,4 +182,8 @@ function utils.version_ge(version1, version2)
182
182
end
183
183
end
184
184
185
+ function utils .is_tarantool_binary (path )
186
+ return path :find (' ^.*/tarantool[^/]*$' ) ~= nil
187
+ end
188
+
185
189
return utils
Original file line number Diff line number Diff line change
1
+ local t = require (' luatest' )
2
+ local g = t .group ()
3
+
4
+ local utils = require (' luatest.utils' )
5
+
6
+ g .test_is_tarantool_binary = function ()
7
+ local cases = {
8
+ {' /usr/bin/tarantool' , true },
9
+ {' /usr/local/bin/tarantool' , true },
10
+ {' /usr/local/bin/tt' , false },
11
+ {' /usr/bin/ls' , false },
12
+ {' /home/myname/app/bin/tarantool' , true },
13
+ {' /home/tarantool/app/bin/go-server' , false },
14
+ {' /usr/bin/tarantool-ee_gc64-2.11.0-0-r577' , true },
15
+ {' /home/tarantool/app/bin/tarantool' , true },
16
+ {' /home/tarantool/app/bin/tarantool-ee_gc64-2.11.0-0-r577' , true },
17
+ }
18
+
19
+ for _ , case in ipairs (cases ) do
20
+ local path , result = unpack (case )
21
+ t .assert_equals (utils .is_tarantool_binary (path ), result ,
22
+ (" Unexpected result for %q" ):format (path ))
23
+ end
24
+ end
You can’t perform that action at this time.
0 commit comments