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 892117030F; Fri, 15 Jan 2021 00:46:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 892117030F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610660803; bh=HhgTN9dyZ6Ml66vSmnfMEBNLQlwZ9AoLGu1Hr/+RoW8=; 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=O9Ziya06ghDQ3zzRJwlbOkhTHelr+3RrSTtFn+rUJrrd/CS0S0h+OHgpLXbDHIRom D2fAeHcvjf6wbpLd9+wuuK06LZA+Vu68b2wYRX3eSzPSXSkXBP59x7b1DeoZPuCabp tPxHOJ2gethupeM+iP1J1ESVm4uOKesZjHxcJkkM= 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 1207D7030F for ; Fri, 15 Jan 2021 00:46:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1207D7030F Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1l0AS1-0003a1-88; Fri, 15 Jan 2021 00:46:41 +0300 To: Sergey Bronnikov , tarantool-patches@dev.tarantool.org References: <1b302a98-cd94-bee3-ee7d-2e64f328bfde@tarantool.org> <6fd57789-56ce-6ce3-fc95-f946beda5bee@tarantool.org> Message-ID: Date: Thu, 14 Jan 2021 22:46:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <6fd57789-56ce-6ce3-fc95-f946beda5bee@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD520EA9A9E182CF906B1BCD0E5756442500894C459B0CD1B914B0EBF6D957D2ED267DDFAF90716F647FA07642535EE9B93B17CAB2765D6A15 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE775E4C393EFDC22A2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FBAD23C389CEF1EB8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC8910D84FD82726EBB23B6BF1286C7066071BA013450FFD0A389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF3735872C767BF85DA29E625A9149C048EE0A3850AC1BE2E735843AE0F20224B8D04AD6D5ED66289B524E70A05D1297E1BB35872C767BF85DA227C277FBC8AE2E8B34FB20EEE7A8894775ECD9A6C639B01B4E70A05D1297E1BBC6867C52282FAC85D9B7C4F32B44FF57E8FBB06288C1946000306258E7E6ABB4E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5E2E01191BFE069F759DA354634CC8DA57AD3FCB0DE267514D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3473457D764E1CDE7720F8A2A0E6E9992BAED9A5E5EA3E2EF3FB94D2B612FA74230940886E49B96F591D7E09C32AA3244CE66C826415FEFC25CE2B142FC2377F663C6EB905E3A8056BFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x5fdeZ3TSUzHg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822DD7D2B3F205CED65E702D93AB784D0693841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >>> 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. >>> 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.