Skip to content

Commit f50c9b5

Browse files
Lord-KATotktonada
authored andcommitted
test/config: upgrade reload_success_case() helper
This helpers does the following: 1. starts a server 2. writes a script/config 3. verifies invariants 4. writes a new script/config 5. reloads 6. verifies invariants after reload This patch allows to set not only script, but config too on the step 4, before the reload. Part of tarantool#8967 NO_DOC=test helper upgrade NO_CHANGELOG=see NO_DOC NO_TEST=see NO_DOC
1 parent 9b0896d commit f50c9b5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/config-luatest/helpers.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,26 @@ end
196196
-- A new script to write into the main.lua file before
197197
-- config:reload().
198198
--
199+
-- * opts.options_2
200+
--
201+
-- A new config to use for the config:reload(). It is optional,
202+
-- if not provided opts.options is used instead.
203+
--
199204
-- * opts.verify_2
200205
--
201206
-- Verify test invariants after config:reload().
202207
local function reload_success_case(g, opts)
203208
local script_2 = opts.script_2
204209
local options = assert(opts.options)
205210
local verify_2 = assert(opts.verify_2)
211+
local options_2 = opts.options_2 or options
206212

207213
local prepared = success_case(g, opts)
208214

209215
prepare_case(g, {
210216
dir = prepared.dir,
211217
script = script_2,
212-
options = options,
218+
options = options_2,
213219
})
214220
g.server:exec(function()
215221
local config = require('config')

0 commit comments

Comments
 (0)