Skip to content

Commit

Permalink
reload_module misc
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Aug 22, 2024
1 parent c646583 commit 160a6ae
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion spec/01-unit/19-hybrid/03-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@ describe("kong.clustering.compat", function()
package.loaded["kong.db.schema.entities.routes"] = nil
package.loaded["kong.db.schema.entities.routes_subschemas"] = nil
package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.clustering.compat"] = nil
package.loaded["kong.db.declarative"] = nil

Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/01-proxy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/02-router_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,6 @@ do
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/06-ssl_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/18-upstream_tls_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/19-grpc_proxy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/23-context_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
1 change: 0 additions & 1 deletion spec/02-integration/05-proxy/26-udp_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ local function reload_router(flavor)
helpers.setenv("KONG_ROUTER_FLAVOR", flavor)

package.loaded["spec.helpers"] = nil
package.loaded["spec.details.misc"] = nil
package.loaded["kong.global"] = nil
package.loaded["kong.cache"] = nil
package.loaded["kong.db"] = nil
Expand Down
12 changes: 11 additions & 1 deletion spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
-- @module spec.helpers

local CONSTANTS = require("spec.details.constants")
local misc = require("spec.details.misc")


local PLUGINS_LIST


local consumers_schema_def = require "kong.db.schema.entities.consumers"
local services_schema_def = require "kong.db.schema.entities.services"
local plugins_schema_def = require "kong.db.schema.entities.plugins"
Expand Down Expand Up @@ -49,6 +50,15 @@ local strip = require("kong.tools.string").strip
local splitlines = require("pl.stringx").splitlines


local function reload_module(name)
package.loaded[name] = nil
return require(name)
end


local misc = reload_module("spec.details.misc")


local conf = misc.conf
local exec = misc.exec
local kong_exec = misc.kong_exec
Expand Down

0 comments on commit 160a6ae

Please sign in to comment.