[Tarantool-patches] [PATCH v7 1/2] luacheck: fix warnings in test/engine
sergeyb at tarantool.org
sergeyb at tarantool.org
Fri Jan 15 15:00:06 MSK 2021
From: Sergey Bronnikov <sergeyb at tarantool.org>
Closes #5458
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 | 2 +-
test/engine/box.lua | 8 +-------
test/engine/conflict.lua | 12 ++++++++----
test/engine/conflict.test.lua | 4 ++--
4 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/.luacheckrc b/.luacheckrc
index b7f9abb45..d58fd57b0 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -39,7 +39,7 @@ exclude_files = {
"test/box/lua/require_mod.lua",
-- Unused source file, to be dropped (gh-5169).
"test/box/lua/test_init.lua",
- "test/engine/**/*.lua",
+ "test/engine/*.test.lua",
"test/engine_long/**/*.lua",
"test/long_run-py/**/*.lua",
"test/luajit-tap/**/*.lua",
diff --git a/test/engine/box.lua b/test/engine/box.lua
index e2f04cba2..8558c9ac0 100644
--- a/test/engine/box.lua
+++ b/test/engine/box.lua
@@ -1,11 +1,5 @@
#!/usr/bin/env tarantool
-os = require('os')
-
-local vinyl = {
- threads = 3,
- range_size=1024*64,
- page_size=1024,
-}
+local os = require('os')
box.cfg{
listen = os.getenv("LISTEN"),
diff --git a/test/engine/conflict.lua b/test/engine/conflict.lua
index b757b81d2..1f9fe5a45 100644
--- a/test/engine/conflict.lua
+++ b/test/engine/conflict.lua
@@ -1,11 +1,11 @@
-function test_conflict()
+local function test_conflict()
local test_run = require('test_run')
local inspector = test_run.new()
local engine = inspector:get_cfg('engine')
local s = box.schema.space.create('tester', {engine=engine});
- local i = s:create_index('test_index', {type = 'tree', parts = {1, 'string'}});
+ s:create_index('test_index', {type = 'tree', parts = {1, 'string'}});
local commits = 0
local function conflict()
@@ -16,10 +16,14 @@ function test_conflict()
end;
local fiber = require('fiber');
- local f0 = fiber.create(conflict);
- local f1 = fiber.create(conflict); -- conflict
+ fiber.create(conflict);
+ fiber.create(conflict); -- conflict
fiber.sleep(0);
s:drop();
return commits
end
+
+return {
+ test_conflict = test_conflict;
+}
diff --git a/test/engine/conflict.test.lua b/test/engine/conflict.test.lua
index d83c03a7a..7744b41b4 100644
--- a/test/engine/conflict.test.lua
+++ b/test/engine/conflict.test.lua
@@ -1,4 +1,4 @@
-dofile('conflict.lua')
+conflict = require('conflict')
-test_conflict()
+conflict.test_conflict()
--
2.25.1
More information about the Tarantool-patches
mailing list