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 8D3CACC309; Thu, 21 Jan 2021 15:51:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8D3CACC309 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1611233506; bh=JQHNn6HGnBEavN1QnBCHbDtq6NiGaSUUSz2PeIt/LeM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vhplcDiSNQHaa7L7G53y0vosuaMAoS/rlapAX13g2QGRS9I7thYdS5Jnli+1u03H5 /bryrCMQbIucA3EunDso06wY3pLlUk11wMLHIXwZubIi5l/O9l9zGF1JecCYR3bOc/ CtLD1bvD+1X9NoQ8aPX8n+SJnzneQgmmgp4HkzNk= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 5B595CC309 for ; Thu, 21 Jan 2021 15:50:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5B595CC309 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1l2ZPv-0007wD-8o; Thu, 21 Jan 2021 15:50:27 +0300 To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Date: Thu, 21 Jan 2021 15:49:57 +0300 Message-Id: <3a5360daf42cd920e3ce536020a6ff2fbccc095e.1611232655.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9FAB20BF8F0759036F8D553AE972D0F0A4ECE5B46F21C4825182A05F5380850409E778116CB37F8DC4639FD82D8B3BCCCB1F6230310643C17025833BDA1320839 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE792E16514AF283DFAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E8D1333770DC60CDEA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1C19460E5213066981D7C350F6738488546A19D09F49F0E35E9FA2833FD35BB23D9E625A9149C048EE9ECD01F8117BC8BEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F7900637E5B3C788B76394F7A7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F10D407B19AF7F7506D8C47C27EEC5E9FB5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DB48C21F01D89DB561574AF45C6390F7469DAA53EE0834AAEE X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C2549B6A8B600A67AE2DDA30E657BBF132086CA07DA28C67E9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF6EA1BA7CA28B4A74699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E9B0C12ABED55137DAA6FAEC75A6AFC570551E0052306FB70A7164E0654E87DCA68703F94290AE011D7E09C32AA3244C21145790FA7889BBE2D55A1E698D6656C3B3ADDA61883BB5927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojYT//mZRaUehBYyGFonWtOQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382219A30AE74FACEA066AFC833A00BDDEAFDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 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: sergeyb@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Sergey Bronnikov W113 (Accessing an undefined global variable) Part of #5464 --- .luacheckrc | 37 +++++++++- test/sql-tap/badutf1.test.lua | 10 ++- test/sql-tap/index1.test.lua | 2 +- test/sql-tap/lua/sqltester.lua | 2 +- test/sql-tap/lua_sql.test.lua | 6 +- test/sql-tap/minmax2.test.lua | 2 + test/sql-tap/select1.test.lua | 4 ++ test/sql-tap/subquery.test.lua | 7 +- test/sql-tap/table.test.lua | 6 +- test/sql-tap/tkt1443.test.lua | 2 +- test/sql-tap/trigger9.test.lua | 1 + test/sql-tap/triggerC.test.lua | 1 - test/sql-tap/view.test.lua | 126 +++++++++++++++------------------ 13 files changed, 122 insertions(+), 84 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 81aa61a2b..eb709d6a3 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -51,8 +51,6 @@ exclude_files = { files["test/sql-tap/**/*.lua"] = { ignore = { - -- Accessing an undefined global variable. - "113", -- Unused local variable. "211", -- Unused argument. @@ -124,3 +122,38 @@ files["test/box-tap/extended_error.test.lua"] = { "forbidden_function", }, } +files["test/sql-tap/analyze5.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/cast.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/func.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/e_expr.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/e_select1.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/misc1.test.lua"] = { + ignore = { + "113", + }, +} +files["test/sql-tap/sort.test.lua"] = { + ignore = { + "113", + }, +} diff --git a/test/sql-tap/badutf1.test.lua b/test/sql-tap/badutf1.test.lua index 654629bf7..b7fa8ce0b 100755 --- a/test/sql-tap/badutf1.test.lua +++ b/test/sql-tap/badutf1.test.lua @@ -93,8 +93,12 @@ test:do_test( }) -- commented as it uses utf16 -if 0>0 then -sql("db2", "") +-- testcases are broken +-- https://github.com/tarantool/tarantool/issues/5743 +local is_gh_5743_closed = false +if is_gh_5743_closed then +sql("db2", "") -- luacheck: ignore sql +-- luacheck: push ignore sql_exec test:do_test( "badutf-1.10", function() @@ -206,7 +210,7 @@ test:do_test( -- }) end - +-- luacheck: pop test:do_test( diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua index ea25727a4..574faafd6 100755 --- a/test/sql-tap/index1.test.lua +++ b/test/sql-tap/index1.test.lua @@ -585,7 +585,7 @@ test:do_test( for i = 1, 50, 1 do test:execsql(string.format("INSERT INTO t3 VALUES('x%sx',%s,0.%s)", i, i, i)) end - local sql_search_count = 0 + -- luacheck: ignore X return X(381, "X!cmd", [=[["concat",[["execsql","SELECT c FROM t3 WHERE b==10"]],["sql_search_count"]]]=]) end, { -- diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua index 169d2f271..bfd14a1a7 100644 --- a/test/sql-tap/lua/sqltester.lua +++ b/test/sql-tap/lua/sqltester.lua @@ -86,7 +86,7 @@ local function is_deeply_regex(got, expected) end if string_regex_p(expected) then - return table_match_regex_p(got, expected) + return table_match_regex_p(got, expected) -- luacheck: ignore table_match_regex_p end if got == nil and expected == nil then return true end diff --git a/test/sql-tap/lua_sql.test.lua b/test/sql-tap/lua_sql.test.lua index b22f195ca..4704970c8 100755 --- a/test/sql-tap/lua_sql.test.lua +++ b/test/sql-tap/lua_sql.test.lua @@ -75,9 +75,10 @@ box.schema.func.create('CHECK_FROM_SQL_TO_LUA', {language = 'Lua', exports = {'LUA', 'SQL'}}) -- check for different types -for i = 1, #from_sql_to_lua, 1 do +for i = 1, #from_sql_to_lua, 1 do -- luacheck: ignore from_sql_to_lua test:do_execsql_test( "lua_sql-2.2."..i, + -- luacheck: ignore from_sql_to_lua "select check_from_sql_to_lua("..i..","..from_sql_to_lua[i][1]..")", {1}) end @@ -102,9 +103,10 @@ box.schema.func.create('CHECK_FROM_LUA_TO_SQL', {language = 'Lua', exports = {'LUA', 'SQL'}}) -- check for different types -for i = 1, #from_lua_to_sql, 1 do +for i = 1, #from_lua_to_sql, 1 do -- luacheck: ignore from_lua_to_sql test:do_execsql_test( "lua_sql-2.3."..i, + -- luacheck: ignore from_lua_to_sql "select "..tostring(from_lua_to_sql[i][1]).." = check_from_lua_to_sql("..i..")", {true}) end diff --git a/test/sql-tap/minmax2.test.lua b/test/sql-tap/minmax2.test.lua index f3d608aab..b6c02a4cc 100755 --- a/test/sql-tap/minmax2.test.lua +++ b/test/sql-tap/minmax2.test.lua @@ -72,6 +72,7 @@ test:do_test( test:do_test( "minmax2-1.2", function() + -- luacheck: ignore sql_search_count return box.stat.sql().sql_search_count - sql_search_count end, 19) @@ -89,6 +90,7 @@ test:do_test( test:do_test( "minmax2-1.4", function() + -- luacheck: ignore sql_search_count return box.stat.sql().sql_search_count - sql_search_count end, 19) diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua index 0e7c5a318..99bcce93b 100755 --- a/test/sql-tap/select1.test.lua +++ b/test/sql-tap/select1.test.lua @@ -1556,6 +1556,7 @@ test:do_test( return box.execute("SELECT * FROM test1 WHERE f1<0").metadata end, { -- + -- luacheck: ignore F1 and F2 and INTEGER {name = F1, type = INTEGER},{name = F2, type = INTEGER} -- }) @@ -1566,6 +1567,7 @@ test:do_test( return box.execute("SELECT * FROM test1 WHERE f1<(select count(*) from test2)").metadata end, { -- + -- luacheck: ignore F1 and F2 and INTEGER {name = F1, type = INTEGER},{name = F2, type = INTEGER} -- }) @@ -1578,6 +1580,7 @@ test:do_test( return box.execute("SELECT * FROM test1 ORDER BY f1").metadata end, { -- + -- luacheck: ignore F1 and F2 and INTEGER {name = F1, type = INTEGER},{name = F2, type = INTEGER} -- }) @@ -1588,6 +1591,7 @@ test:do_test( return box.execute("SELECT * FROM test1 WHERE f1<0 ORDER BY f1").metadata end, { -- + -- luacheck: ignore F1 and F2 and INTEGER {name = F1, type = INTEGER},{name = F2, type = INTEGER} -- }) diff --git a/test/sql-tap/subquery.test.lua b/test/sql-tap/subquery.test.lua index f57a22624..2f92da96c 100755 --- a/test/sql-tap/subquery.test.lua +++ b/test/sql-tap/subquery.test.lua @@ -684,7 +684,7 @@ test:do_test( -- This is the key test. The subquery should have only run once. If -- The double-quoted identifier "two" were causing the subquery to be -- processed as a correlated subquery, then it would have run 4 times. - return callcnt + return callcnt -- luacheck: ignore callcnt end, 1) -- Ticket #1380. Make sure correlated subqueries on an IN clause work @@ -706,7 +706,8 @@ test:do_test( test:do_test( "subquery-6.2", function() - return callcnt + return callcnt -- luacheck: ignore callcnt + end, 4) test:do_test( @@ -725,7 +726,7 @@ test:do_test( test:do_test( "subquery-6.4", function() - return callcnt + return callcnt -- luacheck: ignore callcnt end, 1) box.func.CALLCNT:drop() diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua index 6e45dbab1..2817e1e72 100755 --- a/test/sql-tap/table.test.lua +++ b/test/sql-tap/table.test.lua @@ -417,7 +417,10 @@ test:do_test( test:drop_all_tables() -- MUST_WORK_TEST -if (0 > 0) +-- testcase is broken +-- https://github.com/tarantool/tarantool/issues/5742 +local is_gh_5742_closed = false +if is_gh_5742_closed then test:do_test( "table-5.2.2", @@ -437,6 +440,7 @@ if (0 > 0) -- }) + -- luacheck: ignore X X(313, "X!cmd", [=[["Make","sure","an","EXPLAIN","does","not","really","create","a","new","table"]]=]) end test:do_test( diff --git a/test/sql-tap/tkt1443.test.lua b/test/sql-tap/tkt1443.test.lua index d1d837e72..f40ca16d1 100755 --- a/test/sql-tap/tkt1443.test.lua +++ b/test/sql-tap/tkt1443.test.lua @@ -115,7 +115,7 @@ test:do_test( ); INSERT INTO Permissions VALUES(1, 0, 0, 1, 0, 1); INSERT INTO Permissions VALUES(2, 2, 4, 0, 0, 0); - ]], d)) + ]], d)) -- luacheck: ignore d end, { -- diff --git a/test/sql-tap/trigger9.test.lua b/test/sql-tap/trigger9.test.lua index 5c1f4cbb2..b8e1fc876 100755 --- a/test/sql-tap/trigger9.test.lua +++ b/test/sql-tap/trigger9.test.lua @@ -1,5 +1,6 @@ #!/usr/bin/env tarantool _G.test = require("sqltester") +local test = _G.test test:plan(28) --!./tcltestrunner.lua diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua index e95641938..7d496bc4d 100755 --- a/test/sql-tap/triggerC.test.lua +++ b/test/sql-tap/triggerC.test.lua @@ -791,7 +791,6 @@ for testno, v in ipairs(tests11) do SELECT a,b FROM log; ]] end, { - defaults }) -- diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua index 2f1af29b0..67f461132 100755 --- a/test/sql-tap/view.test.lua +++ b/test/sql-tap/view.test.lua @@ -1,6 +1,6 @@ #!/usr/bin/env tarantool local test = require("sqltester") -test:plan(78) +test:plan(83) --!./tcltestrunner.lua -- 2002 February 26 @@ -501,21 +501,18 @@ test:do_execsql_test( }) -- MUST_WORK_TEST -if (0 > 0) - then - test:do_test( - "view-7.2", - function() - return test:execsql [[ - SELECT * FROM test; - ]] - end, { - -- - 1, 2, 3 - -- - }) +test:do_test( + "view-7.2", + function() + return test:execsql [[ + SELECT * FROM test; + ]] + end, { + -- + 1, 2, 3 + -- + }) -end test:do_execsql_test( "view-7.3", [[ @@ -531,21 +528,18 @@ test:do_execsql_test( }) -- MUST_WORK_TEST -if (0 > 0) - then - test:do_test( - "view-7.4", - function() - return test:execsql [[ - SELECT * FROM test; - ]] - end, { - -- - 1, 2, 3 - -- - }) +test:do_test( + "view-7.4", + function() + return test:execsql [[ + SELECT * FROM test; + ]] + end, { + -- + 1, 2, 3 + -- + }) -end test:do_execsql_test( "view-7.5", [[ @@ -561,21 +555,18 @@ test:do_execsql_test( }) -- MUST_WORK_TEST -if (0 > 0) - then - test:do_test( - "view-7.6", - function() - return test:execsql [[ - SELECT * FROM test; - ]] - end, { - -- - 1, 2, 3 - -- - }) +test:do_test( + "view-7.6", + function() + return test:execsql [[ + SELECT * FROM test; + ]] + end, { + -- + 1, 2, 3 + -- + }) -end test:do_execsql_test( "view-8.1", [[ @@ -588,33 +579,29 @@ test:do_execsql_test( }) -- MUST_WORK_TEST -if (0 > 0) - then - test:do_test( - "view-8.2", - function() - return test:execsql [[ - SELECT * FROM v6 ORDER BY xyz; - ]] - end, { - -- - 7, 2, 13, 5, 19, 8, 27, 12 - -- - }) - - -- MUST_WORK_TEST problem with column names - test:do_execsql_test( - "view-8.3", - [[ - CREATE VIEW v7(a) AS SELECT pqr+xyz FROM v6; - SELECT * FROM v7 ORDER BY a; - ]], { - -- - 9, 18, 27, 39 - -- - }) +test:do_test( + "view-8.2", + function() + return test:execsql [[ + SELECT * FROM v6 ORDER BY xyz; + ]] + end, { + -- + 7, 2, 13, 5, 19, 8, 27, 12 + -- + }) -end +-- MUST_WORK_TEST problem with column names +test:do_execsql_test( + "view-8.3", + [[ + CREATE VIEW v7(a) AS SELECT pqr+xyz FROM v6; + SELECT * FROM v7 ORDER BY a; + ]], { + -- + 9, 18, 27, 39 + -- + }) test:do_execsql_test( "view-8.4", @@ -1124,6 +1111,7 @@ if (0 > 0) function() -- ["unset","-nocomplain","x"] test:execsql("SELECT * FROM x1 x break") + -- luacheck: ignore X return X(797, "X!cmd", [=[["lsort",[["array","names","x"]]]]=]) end, { -- -- 2.25.1