From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 7313245C305 for ; Tue, 8 Dec 2020 14:09:19 +0300 (MSK) From: Oleg Koshovetc Message-ID: Date: Tue, 8 Dec 2020 14:08:34 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: [Tarantool-patches] [PATCH] error: remove failing code from microb integration List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Tikhonov , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org In commit 51836e1fa6d5e040306bbe67ca28525450c8a863 the code responsible for microb integration was removed, but not completely. This remainings caused benchmark to exit with non-zero exit code, which is not good for automation. The other unused code was also removed. I also added .luacheckrc config that could have spotted the error before. ---  .luacheckrc       | 17 +++++++++++++++++  cbench_runner.lua | 30 +++++++++++-------------------  2 files changed, 28 insertions(+), 19 deletions(-)  create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..dd43353 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,17 @@ +redefined = false + +exclude_files = { +    '.rocks', +} + +globals = { +    'box' +} + +ignore = { +    '212', -- unused argument +    '213', -- unused loop variable +    '542', -- empty if branch +} + +-- vim:syntax=lua:sw=4:ts=4:expandtab diff --git a/cbench_runner.lua b/cbench_runner.lua index ecf50b1..79ae794 100755 --- a/cbench_runner.lua +++ b/cbench_runner.lua @@ -1,7 +1,5 @@  --- init tarantool db wor tests - -  if #arg < 1 then      print('Please specify engine [memtx] or [vinyl]')      os.exit(1) @@ -9,6 +7,9 @@ end  local engine = arg[1] +local wal_mode +local count +  if engine == 'vinyl' then      if #arg < 2 then          print('Please specify wal_mode [write] or [fsync]') @@ -40,20 +41,7 @@ end  local version = box.info.version -function split(str, delim) -    if string.find(str, delim) == nil then -        return { str } -    end -    local result, pat, lastpos = {}, "(.-)" .. delim .. "()", nil -    for part, pos in string.gfind(str, pat) do -        table.insert(result, part) -        lastpos = pos -    end -    table.insert(result, string.sub(str, lastpos)) -    return result -end - -function urlencode(t) +local function urlencode(t)      local result = '?'      for key, val in pairs(t) do          if result ~= '?' then @@ -66,6 +54,7 @@ end  -- Workloads  local tests = { 'replaces', 'selects', 'selrepl', 'updates', 'deletes' } +local workloads  if engine == 'vinyl' then      workloads = {          { tests = tests, type = 'tree', parts = { 'num' } }, @@ -93,17 +82,17 @@ if engine == 'memtx' then      }  end -function export(name, bench_key, value) +local function export(name, bench_key, value)      local chart_name = name:gsub(' ', '_'):gsub('+_', ''):lower()      local result = { -        key = token, name = 'cb.' .. bench_key .. '.' .. chart_name, +        name = 'cb.' .. bench_key .. '.' .. chart_name,          param = tostring(math.floor(value)), unit = 'rps',          tab = 'cbench.' .. chart_name, v = version      }      print(urlencode(result))  end -function run() +local function run()      local benches = bench.run(workloads, count, iterations, engine)      for _, data in pairs(benches) do          local name = data[1] @@ -113,5 +102,8 @@ function run()          end      end  end +  run()  os.exit() + +-- vim:ts=4:sw=4:expandtab -- 2.7.4