From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E69447030F; Fri, 15 Jan 2021 12:47:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E69447030F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610704050; bh=kx4lJzKvvOYSOCybq2iPTygEjvht0EmIVvygFVdZtWY=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=aPS7bp3x1UtxFGyLfDgurk+4KDWXbON3b/jg7RaGfSgarIj/q/GcZaCUrMzQAbc37 DBk0e6AsRfwUDiEjpZDlPmNrvULiy51K+1Kbs4snKyWMTsPezZ6LSpzqQ+KygRT2kX hrE1SCqZGZx6mc8fV6/RoSetC1yxcvvYbjd0hAss= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 62E797030F for ; Fri, 15 Jan 2021 12:47:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 62E797030F Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1l0LhY-0004dv-KU; Fri, 15 Jan 2021 12:47:28 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <1b302a98-cd94-bee3-ee7d-2e64f328bfde@tarantool.org> <6fd57789-56ce-6ce3-fc95-f946beda5bee@tarantool.org> Message-ID: Date: Fri, 15 Jan 2021 12:47:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CDDA1A336500443B3AD46BC604C28ED16A00894C459B0CD1B931443B1FF82B618865D380E66D157AB7458FCFA265C3202EB242013FB95F71DC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE709CF9AF650BAB6C1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063724170451E8B6ECF78638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC5C32F25192867AFC96FBB5117DBDA703FF6BB87365BE5805389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF3735872C767BF85DA29E625A9149C048EE1B544F03EFBC4D57444A83B712AC01484AD6D5ED66289B524E70A05D1297E1BB35872C767BF85DA227C277FBC8AE2E8B361A74BF75351E49EFF80C71ABB335746BA297DBC24807EA27F269C8F02392CD20465B3A5AADEC6827F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A546D66DCCA876835427565F4BE17F7F8995638107D5DA56BDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3468964757141B82E0F9F850DAE6F99A3429E0533099B7CCAE39226E23927E168B8C731D42727C17B11D7E09C32AA3244CD08730D2B587C037F65514A244A34AE5408A6A02710B7304FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojT/h6YDL0UQ6TOFWSBA/68A== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638228B379E2AE556EAC83B6993953B09847DDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v7] test: fix luacheck warnings in test/long_run-py X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 15.01.2021 00:46, Vladislav Shpilevoy wrote: >>>> diff --git a/test/long_run-py/lua/finalizers.lua b/test/long_run-py/lua/finalizers.lua >>>> index 69146a323..cb6400363 100644 >>>> --- a/test/long_run-py/lua/finalizers.lua >>>> +++ b/test/long_run-py/lua/finalizers.lua >>>> @@ -1,19 +1,17 @@ >>>>   #!/usr/bin/env tarantool >>>>   -function on_gc(t) >>>> +local function on_gc() >>>>   end; >>>>   -function test_finalizers() >>>> +local function test_finalizers() >>>>       local result = {} >>>>       local i = 1 >>>>       local ffi = require('ffi') >>>>       while true do >>>> -        result[i] = ffi.gc(ffi.cast('void *', 0), on_gc) >>>> +        local result[i] = ffi.gc(ffi.cast('void *', 0), on_gc) >>> 2. This change is not correct. Even luacheck tells it, if you don't >>> ignore this file. You assign a value to a table member, not >>> declare a variable. >> It is still not unclear for me why luacheck complains here. >> >> result table declared before a loop and scope for it is a whole function body, what's wrong? >> >> Similar lua chunk successfully executed by puc lua: >> >> local result = {} >> local i = 0 >> while i == 0 do >>     result[i] = 1 >> end > Your chunk is similar, but not the same. Originally you used 'local result[i] = ...' > expression which is obviously wrong. You can't "declare" a table member as local. > 'result[i]' is not a valid variable name, so it can't be used with 'local' keyword > to declare it as a variable. Got it, thanks. >>>> diff --git a/test/long_run-py/suite.lua b/test/long_run-py/suite.lua >>>> index 0b33dec7d..7a09dd2b8 100644 >>>> --- a/test/long_run-py/suite.lua >>>> +++ b/test/long_run-py/suite.lua >>>> @@ -109,3 +106,8 @@ function delete_insert(engine_name) >>>>       box.space.tester:drop() >>>>       return {counter, string_value_2} >>>>   end >>>> + >>>> +return { >>>> +    delete_replace_update = delete_replace_update; >>>> +    delete_insert = delete_insert; >>> 3. Please, use ',' instead of ';'. >>> >> Fixed in a branch. > I realized suite.lua functions are never used. The file is imported in > long_run-py/box.lua, but the imported functions are not used. I deleted > it and the tests pass. I suggest you to delete this file entirely: > > ==================== > diff --git a/test/long_run-py/box.lua b/test/long_run-py/box.lua > index b4f65dcdb..354e680b4 100644 > --- a/test/long_run-py/box.lua > +++ b/test/long_run-py/box.lua > @@ -1,7 +1,5 @@ > #!/usr/bin/env tarantool > > -require('suite') > - > os.execute("rm -rf vinyl_test") > os.execute("mkdir -p vinyl_test") > > diff --git a/test/long_run-py/suite.ini b/test/long_run-py/suite.ini > index 110bbb548..7561fdb5a 100644 > --- a/test/long_run-py/suite.ini > +++ b/test/long_run-py/suite.ini > @@ -5,7 +5,6 @@ script = box.lua > long_run = finalizers.test.py > valgrind_disabled = > release_disabled = > -lua_libs = suite.lua > use_unix_sockets = True > use_unix_sockets_iproto = True > is_parallel = True > > + delete suite.lua file. Done. CI: https://gitlab.com/tarantool/tarantool/-/pipelines/242068204