[Tarantool-patches] [PATCH luajit] test: fix directory detection in lua-Harness suite

Sergey Ostanevich sergos at tarantool.org
Mon Apr 19 17:09:43 MSK 2021


Hi!

Thanks for the patch! 
Just couple nits, LGTM.

Sergos

> On 16 Apr 2021, at 21:21, Sergey Kaplun <skaplun at tarantool.org> wrote:
> 
> <314-regex.t> uses `arg[0]:find'314'` to determine the name of the
 ^
A test ... 

Perhaps it’s just me, but I had a hard time to get rid of feeling I read
a hypertext in plain format. 

> directory where rx_* files are located. This leads to the test
> failure, when lua-Harness suite run in the directory containing
                                         ^ a
You do not refer to a particular directory here, rather say ‘consider it is
run in a directory …'

> "314" in its name, because the found path doesn't contain the required
> files.
> 
> This patch fixes directory name detection.
> 
> Follows up tarantool/tarantool#5844
> ---
> 
> I tested it locally on branch in directory containing "314" in the name.
> Also, I grepped the test suites with "find", "match", "sub" patterns,
> but didn't see other places with such bug like that.
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-harness-314-find-bug
> Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-harness-314-find-bug
> 
> test/lua-Harness-tests/314-regex.t | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/lua-Harness-tests/314-regex.t b/test/lua-Harness-tests/314-regex.t
> index ad4554cd..58cdb66e 100755
> --- a/test/lua-Harness-tests/314-regex.t
> +++ b/test/lua-Harness-tests/314-regex.t
> @@ -164,7 +164,7 @@ local function split (line)
> end
> 
> local test_number = 0
> -local dirname = arg[0]:sub(1, arg[0]:find'314' -1)
> +local dirname = arg[0]:gsub('([^/]+)%.t$', '')
> for _, filename in ipairs(test_files) do
>     local f, msg = io.open(dirname .. filename, 'r')
>     if f == nil then
> -- 
> 2.31.0
> 



More information about the Tarantool-patches mailing list