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 5151 when a server fails to start due to bad configuration.
5252- Save server artifacts (logs, snapshots, etc.) if the test fails.
5353- Group working directories of servers inside a replica set into one directory.
54+ - Fix collecting coverage if tarantool binary has a suffix.
5455
5556## 0.5.7
5657
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ function Server:initialize()
169169 table.insert (self .args , 3 , self .command )
170170 self .command = arg [- 1 ]
171171 -- If command is tarantool, add `-l luatest.coverage`
172- elseif self .command : endswith ( ' /tarantool ' ) then
172+ elseif utils . is_tarantool_binary ( self .command ) then
173173 if not fun .index (' luatest.coverage' , self .args ) then
174174 table.insert (self .args , 1 , ' -l' )
175175 table.insert (self .args , 2 , ' luatest.coverage' )
@@ -248,7 +248,7 @@ function Server:start(opts)
248248 local args = table .copy (self .args )
249249 local env = table .copy (os .environ ())
250250
251- if not command : endswith ( ' /tarantool ' ) then
251+ if not utils . is_tarantool_binary ( self . command ) then
252252 -- When luatest is installed as a rock, the internal server_instance.lua
253253 -- script won't have execution permissions even though it has them in the
254254 -- 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)
182182 end
183183end
184184
185+ function utils .is_tarantool_binary (path )
186+ return path :find (' ^.*/tarantool[^/]*$' ) ~= nil
187+ end
188+
185189return 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