From 03ab26c0c10f95483cb7d64c371b536d9b738d73 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Thu, 10 Oct 2024 11:06:44 +0800 Subject: [PATCH] tests(helpers): fixed wrong setting conf.database in get_db_utils --- spec/internal/db.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/internal/db.lua b/spec/internal/db.lua index 9895181fdeb8..16cf4506fba6 100644 --- a/spec/internal/db.lua +++ b/spec/internal/db.lua @@ -277,6 +277,8 @@ end -- } local function get_db_utils(strategy, tables, plugins, vaults, skip_migrations) strategy = strategy or conf.database + conf.database = strategy + if tables ~= nil and type(tables) ~= "table" then error("arg #2 must be a list of tables to truncate", 2) end @@ -314,12 +316,6 @@ local function get_db_utils(strategy, tables, plugins, vaults, skip_migrations) bootstrap_database(db) end - do - local database = conf.database - conf.database = strategy - conf.database = database - end - db:truncate("plugins") assert(db.plugins:load_plugin_schemas(conf.loaded_plugins)) assert(db.vaults:load_vault_schemas(conf.loaded_vaults))