From: "Alexander Tikhonov" <avtikhon@tarantool.org> To: tarantool-patches <tarantool-patches@freelists.org>, "Alexander Turenko" <alexander.turenko@tarantool.org> Subject: [tarantool-patches] [PATCH 1/1] pre_cleanup routine enabled with updated tests for it Date: Tue, 26 Feb 2019 17:49:42 +0300 [thread overview] Message-ID: <1551192582.239286124@f273.i.mail.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 7902 bytes --] test: pre_cleanup routine switched on Corrected and switched on the pre_cleanup routine, which cleanups the schemas and functions between running tests. All failed tests changed to be able to run with the routine. At the box and engine_long suites the common global functions moved to the modules to avoid of its cleanup between tests. Partly fix #3863 --- Travis-ci: https://travis-ci.org/tarantool/tarantool/builds/498752667 Branch: https://github.com/tarantool/tarantool/tree/avtikhon/gh-3863-run-cleaner diff --git a/test-run b/test-run index 02207efd2..7552a0e6a 160000 --- a/test-run +++ b/test-run @@ -1 +1 @@ -Subproject commit 02207efd2ca44067b76c79bf012f142016d929ae +Subproject commit 7552a0e6a36f24d6961c16dd4e6e44c53e410567 diff --git a/test/box/admin.result b/test/box/admin.result index e6fc1f302..2e93f386b 100644 --- a/test/box/admin.result +++ b/test/box/admin.result @@ -24,7 +24,10 @@ help() \help show this screen \quit quit interactive console ... -cfg_filter(box.cfg) +box_cfg_module = require('cfg_filter') +--- +... +box_cfg_module.cfg_filter(box.cfg) --- - - - background - false diff --git a/test/box/admin.test.lua b/test/box/admin.test.lua index 4e7a78f5b..bf587ccfc 100644 --- a/test/box/admin.test.lua +++ b/test/box/admin.test.lua @@ -6,7 +6,8 @@ space = box.schema.space.create('tweedledum') index = space:create_index('primary') help() -cfg_filter(box.cfg) +box_cfg_module = require('cfg_filter') +box_cfg_module.cfg_filter(box.cfg) space:insert{1, 'tuple'} box.snapshot() space:delete{1} diff --git a/test/box/box.lua b/test/box/box.lua index b3b10ffd4..0fc93eaf0 100644 --- a/test/box/box.lua +++ b/test/box/box.lua @@ -9,26 +9,6 @@ box.cfg{ require('console').listen(os.getenv('ADMIN')) -local _hide = { - pid_file=1, log=1, listen=1, vinyl_dir=1, - memtx_dir=1, wal_dir=1, - memtx_max_tuple_size=1, memtx_min_tuple_size=1 -} - -function cfg_filter(data) - if type(data)~='table' then return data end - local keys,k,_ = {} - for k in pairs(data) do - table.insert(keys, k) - end - table.sort(keys) - local result = {} - for _,k in pairs(keys) do - table.insert(result, {k, _hide[k] and '<hidden>' or cfg_filter(data[k])}) - end - return result -end - function compare(a,b) return a[1] < b[1] end diff --git a/test/box/cfg.result b/test/box/cfg.result index 7778f82ac..f0e755436 100644 --- a/test/box/cfg.result +++ b/test/box/cfg.result @@ -1,3 +1,6 @@ +box_cfg_module = require('cfg_filter') +--- +... env = require('test_run') --- ... @@ -12,7 +15,7 @@ box.cfg.nosuchoption = 1 --- - error: 'builtin/box/load_cfg.lua:<line>: Attempt to modify a read-only table' ... -cfg_filter(box.cfg) +box_cfg_module.cfg_filter(box.cfg) --- - - - background - false @@ -111,7 +114,7 @@ cfg_filter(box.cfg) box.cfg() --- ... -cfg_filter(box.cfg) +box_cfg_module.cfg_filter(box.cfg) --- - - - background - false diff --git a/test/box/cfg.test.lua b/test/box/cfg.test.lua index a6416241f..dcacb4d65 100644 --- a/test/box/cfg.test.lua +++ b/test/box/cfg.test.lua @@ -1,11 +1,13 @@ +box_cfg_module = require('cfg_filter') + env = require('test_run') test_run = env.new() test_run:cmd("push filter '(error: .*)\\.lua:[0-9]+: ' to '\\1.lua:<line>: '") box.cfg.nosuchoption = 1 -cfg_filter(box.cfg) +box_cfg_module.cfg_filter(box.cfg) -- must be read-only box.cfg() -cfg_filter(box.cfg) +box_cfg_module.cfg_filter(box.cfg) -- check that cfg with unexpected parameter fails. box.cfg{sherlock = 'holmes'} diff --git a/test/box/lua/cfg_filter.lua b/test/box/lua/cfg_filter.lua new file mode 100644 index 000000000..31b077c37 --- /dev/null +++ b/test/box/lua/cfg_filter.lua @@ -0,0 +1,23 @@ +local box_cfg_module = {} + +local _hide = { + pid_file=1, log=1, listen=1, vinyl_dir=1, + memtx_dir=1, wal_dir=1, + memtx_max_tuple_size=1, memtx_min_tuple_size=1 +} + +function box_cfg_module.cfg_filter(data) + if type(data)~='table' then return data end + local keys,k,_ = {} + for k in pairs(data) do + table.insert(keys, k) + end + table.sort(keys) + local result = {} + for _,k in pairs(keys) do + table.insert(result, {k, _hide[k] and '<hidden>' or box_cfg_module.cfg_filter(data[k])}) + end + return result +end + +return box_cfg_module diff --git a/test/box/suite.ini b/test/box/suite.ini index fee1c40b4..346536c1c 100644 --- a/test/box/suite.ini +++ b/test/box/suite.ini @@ -4,6 +4,6 @@ description = Database tests script = box.lua disabled = rtree_errinj.test.lua tuple_bench.test.lua release_disabled = errinj.test.lua errinj_index.test.lua rtree_errinj.test.lua upsert_errinj.test.lua iproto_stress.test.lua -lua_libs = lua/fifo.lua lua/utils.lua lua/bitset.lua lua/index_random_test.lua lua/push.lua lua/identifier.lua +lua_libs = lua/cfg_filter.lua lua/fifo.lua lua/utils.lua lua/bitset.lua lua/index_random_test.lua lua/push.lua lua/identifier.lua use_unix_sockets = True is_parallel = True diff --git a/test/engine_long/delete_insert.test.lua b/test/engine_long/delete_insert.test.lua index 275aaa23e..83119cf14 100644 --- a/test/engine_long/delete_insert.test.lua +++ b/test/engine_long/delete_insert.test.lua @@ -1,6 +1,9 @@ +el_mod = require("suite") + test_run = require('test_run') inspector = test_run.new() engine = inspector:get_cfg('engine') iterations = 100000 + math.randomseed(1) -delete_insert(engine, iterations) +el_mod.delete_insert(engine, iterations) diff --git a/test/engine_long/delete_replace_update.test.lua b/test/engine_long/delete_replace_update.test.lua index 466b8f007..004597b15 100644 --- a/test/engine_long/delete_replace_update.test.lua +++ b/test/engine_long/delete_replace_update.test.lua @@ -1,17 +1,19 @@ +el_mod = require("suite") + engine_name = 'memtx' iterations = 100000 math.randomseed(1) -delete_replace_update(engine_name, iterations) +el_mod.delete_replace_update(engine_name, iterations) math.randomseed(2) -delete_replace_update(engine_name, iterations) +el_mod.delete_replace_update(engine_name, iterations) math.randomseed(3) -delete_replace_update(engine_name, iterations) +el_mod.delete_replace_update(engine_name, iterations) math.randomseed(4) -delete_replace_update(engine_name, iterations) +el_mod.delete_replace_update(engine_name, iterations) math.randomseed(5) -delete_replace_update(engine_name, iterations) +el_mod.delete_replace_update(engine_name, iterations) diff --git a/test/engine_long/suite.lua b/test/engine_long/suite.lua index 464138db1..4db885031 100644 --- a/test/engine_long/suite.lua +++ b/test/engine_long/suite.lua @@ -1,3 +1,4 @@ +local engine_long_module = {} function string_function() local random_number @@ -10,7 +11,7 @@ function string_function() return random_string end -function delete_replace_update(engine_name, iterations) +function engine_long_module.delete_replace_update(engine_name, iterations) local string_value if (box.space._space.index.name:select{'tester'}[1] ~= nil) then box.space.tester:drop() @@ -69,7 +70,7 @@ function delete_replace_update(engine_name, iterations) return {counter, random_number, string_value_2, string_value_3} end -function delete_insert(engine_name, iterations) +function engine_long_module.delete_insert(engine_name, iterations) local string_value if (box.space._space.index.name:select{'tester'}[1] ~= nil) then box.space.tester:drop() @@ -107,3 +108,5 @@ function delete_insert(engine_name, iterations) box.space.tester:drop() return {counter, string_value_2} end + +return engine_long_module -- Alexander Tikhonov [-- Attachment #2: Type: text/html, Size: 10271 bytes --]
next reply other threads:[~2019-02-26 14:49 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-26 14:49 Alexander Tikhonov [this message] 2019-02-26 15:21 ` [tarantool-patches] " Alexander Tikhonov
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=1551192582.239286124@f273.i.mail.ru \ --to=avtikhon@tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH 1/1] pre_cleanup routine enabled with updated tests for it' \ /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