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 8E5A54C889; Thu, 14 Jan 2021 11:59:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E5A54C889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610614743; bh=bv5i0FLNKmmu/9ypFXH5JeDKA+IabFpjfstPV5IsiNk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hm+654BqdnnzeWSbL8Yr303HgGWUNSI4vywdMx1OsZuE3izFkLyCURXdMNBv3y9D9 XHXYdtj7+Qk7lquorFQAGa1cawmNifOFAXYtsvHl9RO38fqFzopbx5WafyYO0VWGCT 1cBaevz90o4cR76lk1FfdXjm0BWkTZ9Z4TqlFt0k= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 067184C885 for ; Thu, 14 Jan 2021 11:59:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 067184C885 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1kzyT8-0003Wb-54; Thu, 14 Jan 2021 11:59:02 +0300 To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Date: Thu, 14 Jan 2021 11:58:48 +0300 Message-Id: <8fc4ccf108670e084a735b2d2a4ea74d5c0c653d.1610614496.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD9807AE62CAC2B33C765C844EAC374FFF00894C459B0CD1B9DAEEB53934E0BC82C637F677B51ED5B141B91D94412F7D59AF5C6C36E0A87868 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7571C18AED7CB6805EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BD378188104BC8BE8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC0C6E0E68801B4CDCF25F2AA9D2705D7468D46C9D2CC44584389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0ECC8AC47CD0EDEFF8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD26923F8577A6DFFEA7CE2071C6999E77799D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3C824672CB62AFFF2BA3038C0950A5D36B5C8C57E37DE458B92C30CA92C8B5C6467F23339F89546C55F5C1EE8F4F765FC6435C1528B3C0E0675ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE493B89ED3C7A62817816436AE5DD6441DC7C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC44C234C8B12C006B7A0C6E0E68801B4CDCF25F2AA9D2705D74134F12A6CF8779EEB1881A6453793CE9C32612AADDFBE061789D29E1AC71D179C581CE5390BD6510A5FCC33AE53B6E92BB52A3B5A10F442104EBA3D8E7E5B87ABF8C51168CD8EBDBECADA55FE5B58BB7DC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340A58BF0C7EAC340F4FA291A7F05A5AF0A1A97CAFE2F5273385FB3EBB8B2105BDE2D7FBE9BCABB8D71D7E09C32AA3244C7485E1629E3EF8FA7D06AE56599D490A7101BF96129E4011927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x4PNuxP1OH+/Q== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884580372850E914F2F60A6754B3EAF190B8DFD3A7B8FD6BAC8F3282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v7] test: fix luacheck warnings in test/vinyl 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 Closes #5466 Reviewed-by: Vladislav Shpilevoy Reviewed-by: Igor Munkin Co-authored-by: Vladislav Shpilevoy Co-authored-by: Igor Munkin --- Changelog v7: - reverted changes with redefinitions - rebased to a master branch Changelog v6: - splitted patch in test/ for patches per sub-directory - adjusted supressions in .luacheckrc - fixed formatting issues in .luacheckrc - fixed warnings in test/vinyl/vinyl.lua and test/vinyl/large.lua Gitlab CI: https://gitlab.com/tarantool/tarantool/-/pipelines/241521801 Issue: https://github.com/tarantool/tarantool/issues/5466 Branch: ligurio/gh-5466-luacheck-warnings-test-vinyl .luacheckrc | 2 +- test/box/lua/txn_proxy.lua | 6 +++--- test/vinyl/large.lua | 3 +-- test/vinyl/stress.lua | 10 +++++----- .../2.5.1/gh-5107-upsert-upgrade/fill.lua | 4 ++-- test/vinyl/vinyl.lua | 17 ----------------- 6 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 4b829f3dc..c90e113e5 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -44,7 +44,7 @@ exclude_files = { "test/sql/**/*.lua", "test/swim/**/*.lua", "test/var/**/*.lua", - "test/vinyl/**/*.lua", + "test/vinyl/*.test.lua", "test/wal_off/**/*.lua", "test/xlog/**/*.lua", "test/xlog-py/**/*.lua", diff --git a/test/box/lua/txn_proxy.lua b/test/box/lua/txn_proxy.lua index 7a4d0b865..15b0e4add 100644 --- a/test/box/lua/txn_proxy.lua +++ b/test/box/lua/txn_proxy.lua @@ -1,11 +1,11 @@ --- A fiber can't use multiple transactions simultaneously; +-- A fiber can't use multiple transactions simultaneously; -- i.e. [fiber] --? [transaction] in UML parlor. -- -- This module provides a simple transaction proxy facility --- to control multiple transactions at once. A proxy executes +-- to control multiple transactions at once. A proxy executes -- statements in a worker fiber in order to overcome -- "one transaction per fiber" limitation. --- +-- -- Ex: -- proxy = require('txn_proxy').new() -- proxy:begin() diff --git a/test/vinyl/large.lua b/test/vinyl/large.lua index e10e94c1a..a997aec7e 100644 --- a/test/vinyl/large.lua +++ b/test/vinyl/large.lua @@ -1,5 +1,4 @@ -fiber = require('fiber') -digest = require('digest') +local digest = require('digest') local PAGE_SIZE = 1024 local RANGE_SIZE = 64 * PAGE_SIZE diff --git a/test/vinyl/stress.lua b/test/vinyl/stress.lua index 5e8d89795..d8c1b631c 100644 --- a/test/vinyl/stress.lua +++ b/test/vinyl/stress.lua @@ -62,7 +62,7 @@ local function t2(ch, time_limit) local t = math.random(16) local space = spaces[math.fmod(t, #spaces) + 1] if t < 12 then - local l = space:get({k}) + space:get({k}) else space:delete({k}) end @@ -99,19 +99,19 @@ local function stress(time_limit) math.randomseed(os.time()); - for i = 1, 6 do + for _ = 1, 6 do fiber.create(t1, ch, time_limit) end; - for i = 1, 6 do + for _ = 1, 6 do fiber.create(t2, ch, time_limit) end; - for i = 1, 4 do + for _ = 1, 4 do fiber.create(t3, ch, time_limit) end; - for i = 1, 16 do + for _ = 1, 16 do ch:get() end; end diff --git a/test/vinyl/upgrade/2.5.1/gh-5107-upsert-upgrade/fill.lua b/test/vinyl/upgrade/2.5.1/gh-5107-upsert-upgrade/fill.lua index 1916aea6e..64b375462 100644 --- a/test/vinyl/upgrade/2.5.1/gh-5107-upsert-upgrade/fill.lua +++ b/test/vinyl/upgrade/2.5.1/gh-5107-upsert-upgrade/fill.lua @@ -1,7 +1,7 @@ box.cfg{} -s = box.schema.create_space('test', {engine = 'vinyl'}) -pk = s:create_index('pk') +local s = box.schema.create_space('test', {engine = 'vinyl'}) +s:create_index('pk') s:insert({1, 2}) box.snapshot() s:upsert({1, 0}, {{'+', 2, 1}}) diff --git a/test/vinyl/vinyl.lua b/test/vinyl/vinyl.lua index 31307f4bc..1d313b4e4 100644 --- a/test/vinyl/vinyl.lua +++ b/test/vinyl/vinyl.lua @@ -15,21 +15,4 @@ box.cfg { vinyl_max_tuple_size = 1024 * 1024 * 6, } -function box_info_sort(data) - if type(data)~='table' then - return data - end - local keys = {} - for k in pairs(data) do - table.insert(keys, k) - end - table.sort(keys) - local result = {} - for _,k in pairs(keys) do - local v = data[k] - table.insert(result, {[k] = box_info_sort(v) }) - end - return result -end - require('console').listen(os.getenv('ADMIN')) -- 2.25.1