[Tarantool-patches] [PATCH 07/19] Fix luacheck warnings in test/engine_long

sergeyb at tarantool.org sergeyb at tarantool.org
Thu Jul 16 17:11:32 MSK 2020


From: Sergey Bronnikov <sergeyb at tarantool.org>

Part of #4681

Reviewed-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
Reviewed-by: Igor Munkin <imun at tarantool.org>

Co-authored-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
Co-authored-by: Igor Munkin <imun at tarantool.org>
---
 .luacheckrc                | 8 +++++++-
 test/engine_long/suite.lua | 5 +----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index e0446f9be..c7854659c 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -42,7 +42,7 @@ exclude_files = {
     -- Unused source file, to be dropped (gh-5169).
     "test/box/lua/test_init.lua",
     "test/engine/*.test.lua",
-    "test/engine_long/*.lua",
+    "test/engine_long/*.test.lua",
     "test/long_run-py/**/*.lua",
     "test/replication/**/*.lua",
     "test/replication-py/**/*.lua",
@@ -163,3 +163,9 @@ files["test/engine/conflict.lua"] = {
         "test_conflict",
     },
 }
+files["test/engine_long/suite.lua"] = {
+    globals = {
+        "delete_replace_update",
+        "delete_insert",
+    }
+}
diff --git a/test/engine_long/suite.lua b/test/engine_long/suite.lua
index 9ac2bff9f..586160a1a 100644
--- a/test/engine_long/suite.lua
+++ b/test/engine_long/suite.lua
@@ -2,7 +2,7 @@ local function string_function()
     local random_number
     local random_string
     random_string = ""
-    for x = 1,20,1 do
+    for _ = 1,20,1 do
         random_number = math.random(65, 90)
         random_string = random_string .. string.char(random_number)
     end
@@ -10,7 +10,6 @@ local function string_function()
 end
 
 function delete_replace_update(engine_name, iterations)
-    local string_value
     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then
         box.space.tester:drop()
     end
@@ -40,7 +39,6 @@ function delete_replace_update(engine_name, iterations)
         random_number = math.random(1,6)
 
         string_value_3 = string_function()
---      print('<'..counter..'> [' ..  random_number .. '] value_2: ' .. string_value_2 .. ' value_3: ' .. string_value_3)
         if random_number == 1 then
             box.space.tester:delete{string_value_2}
         end
@@ -69,7 +67,6 @@ function delete_replace_update(engine_name, iterations)
 end
 
 function delete_insert(engine_name, iterations)
-    local string_value
     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then
         box.space.tester:drop()
     end
-- 
2.26.2



More information about the Tarantool-patches mailing list