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 8E31C6EC71; Sat, 27 Feb 2021 20:09:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E31C6EC71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614445752; bh=ubpT3MDlpfWzm4QwIHFMkoTI+cG7t4sGS4lLgorQA5E=; 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=Zg03giZ1pWwaTz+N2LRM+jUDi8n+nrWnEIDpOhY4DEu5IV7cbrBBbirKhh1bzqHfU GMYY1lSeF/n/q+NEu/8QfoJPyIxAUKhn51ILj4k/zah6aHRMER23hSYM9IJRPSgAY5 9S9JDaERIbcSsYoWrsWny+zQhAfzo9RrIrVcE800= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 552456EC71 for ; Sat, 27 Feb 2021 20:09:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 552456EC71 Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lG35a-00073j-FF; Sat, 27 Feb 2021 20:09:10 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> Message-ID: <33adda25-ba4d-b50c-575e-9dd30b38488a@tarantool.org> Date: Sat, 27 Feb 2021 20:09:09 +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: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9795828B892398B728FC1D9EEA0F34691E83D75D24C38BB42182A05F5380850408407D54DEC09A62790F3D2D316B8E7C568ACBFF5F8232C1DA94DD76DF72CC621 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75C385DEB91CEC222EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378997215BCAA11D778638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C25752893F242F32CE5246174CEA4676ADE38CE23DD82EF82A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7328B01A8D746D8839FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C353FA85A707D24CADCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224966D89E201A891B4676E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8BE95B4490390D5D973AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE73A6989AD488FD87D67F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C341E1C46B3B04646035872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5320E181EA83A849426BE88D51FDA46EC2CB56B522986770FD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75968C9853642EB7C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BF5454112BD5BFD7DA6B98643C6FCBC131625540B4FF509C9F274411B8F6ECF81BA9FC874C8A10301D7E09C32AA3244CD3A06BFF2B84A47D266EDA5FD594A2CE35DA7DC5AF9B58C0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojzT24cXffn6w6TChBhaiDqQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458405D2CAB530439F270DEE72867584700F7ECE4C32DA35268282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 in test/sql-tap 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" Hello! On 27.02.2021 02:42, Vladislav Shpilevoy wrote: > Thanks for the fixes! > >>>> diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua >>>> index 9cd517673..5dab23007 100755 >>>> --- a/test/sql-tap/func.test.lua >>>> +++ b/test/sql-tap/func.test.lua >>>> @@ -1382,7 +1380,6 @@ test:do_execsql_test( >>>>       }) >>>>     db("cache", "flush") >>>> -V = "three" >>> 2. 'V' is supposed to be a variable. It is used in the queries >>> in the surrounding code. Please, don't delete parts of the tests. >>> It will not make it simpler to restore the context later. The tests >>> in this patchset either must be deleted, or resurrected, or hacked >>> to keep their context and not fail luacheck. What to choose - depends >>> on individual tests. Here clearly we need to keep 'V'. Try to make >>> another pass of self-review to locate more of such test-"breaking" >>> changes. >> reverted and suppressed >> >> --- a/test/sql-tap/func.test.lua >> +++ b/test/sql-tap/func.test.lua >> @@ -1382,6 +1382,7 @@ test:do_execsql_test( >>      }) >> >>  db("cache", "flush") >> +local V = "three" -- luacheck: no unused >>  test:do_execsql_test( >>      "13.8.6", >>      [[ > Now take a look at the diff in this file: > > ==================== > @@ -1361,7 +1361,6 @@ test:do_execsql_test( > -- > }) > > -local V = "one" > test:do_execsql_test( > "13.8.4", > [[ > @@ -1372,7 +1371,6 @@ test:do_execsql_test( > -- > }) > > -V = "two" > test:do_execsql_test( > "13.8.5", > [[ > @@ -1384,7 +1382,7 @@ test:do_execsql_test( > }) > > db("cache", "flush") > -V = "three" > +local V = "three" -- luacheck: no unused > ==================== > > The comment wasn't about only "three". You shouldn't delete > "two" and "one", obviously. By the same reason. They are > "used" in these not working tests. Agree, looks bad. Fixed for "one" and "two" too. >> diff --git a/test/sql-tap/select9.test.lua b/test/sql-tap/select9.test.lua >> index 4f7da84e2..045d0e4c8 100755 >> --- a/test/sql-tap/select9.test.lua >> +++ b/test/sql-tap/select9.test.lua >> @@ -274,10 +274,8 @@ test:do_execsql_test( >> -- >> }) >> >> -local t1_space_id = "" >> -local t2_space_id = "" >> -t1_space_id = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> -t2_space_id = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >> +local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> +local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >> --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n set t2_space_id $data(id)\n"]]=]) >> --local function reverse(lhs, rhs) >> -- return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) > t2_space_id is used in the commented code. But it looks already > corrupted, I can't even closely understand what is happening here. I read a history of commits for select9.test.lua and "t{1,2}_space_id" haven't changed since initial import. See [1]. > t2_space_id and t1_space_id are obvious names anyway, so we probably could > just delete their declaration and assignment but keep t2_space_id usage > in the commented code. > > Or comment them out too. removed: --- a/test/sql-tap/select9.test.lua +++ b/test/sql-tap/select9.test.lua @@ -274,10 +274,8 @@ test:do_execsql_test(          --      }) -local t1_space_id = "" -local t2_space_id = "" -t1_space_id = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] -t2_space_id = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] +local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] +local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"]  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=])  --local function reverse(lhs, rhs)  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) 1. https://github.com/tarantool/tarantool/commit/47b70d97579a0f9fb59ab122cc97cea4a616be3d#diff-e2e23d907919e91e8ea29b579fd5caa73fd7526b242f65688c2c3939a45372a7R276-R279