Skip to content

Commit

Permalink
tests(helpers): fixed wrong setting conf.database in get_db_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Oct 10, 2024
1 parent 3a3b6ac commit 03ab26c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions spec/internal/db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 03ab26c

Please sign in to comment.