From 3970e32f734ab6c3ca5dab093709b8b318bb9c91 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Thu, 10 Oct 2024 14:55:39 +0800 Subject: [PATCH] tests(helpers): fixed incorrect conf.database setting 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..8fe43da18d71 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 -- overwrite kong.configuration.database + 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))