Tarantool development patches archive
 help / color / mirror / Atom feed
From: Oleg Koshovetc <okoshovetc@tarantool.org>
To: Alexander Tikhonov <avtikhon@tarantool.org>,
	Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH] error: remove failing code from microb integration
Date: Tue, 8 Dec 2020 14:08:34 +0300	[thread overview]
Message-ID: <ec4c02ca-4b30-c9f8-bd2e-67bb1f4562d7@tarantool.org> (raw)

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

             reply	other threads:[~2020-12-08 11:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 11:08 Oleg Koshovetc [this message]
2020-12-08 11:16 ` Oleg Koshovetc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec4c02ca-4b30-c9f8-bd2e-67bb1f4562d7@tarantool.org \
    --to=okoshovetc@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] error: remove failing code from microb integration' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox