diff --git a/spec/config.ld b/spec/config.ld index 79e2c9838615..647ab6e8952a 100644 --- a/spec/config.ld +++ b/spec/config.ld @@ -2,7 +2,7 @@ project='Kong test helpers' title='Kong test framework' description='Test helper functions for Kong (integration) testing' format='markdown' -file={'./helpers.lua','./helpers','./details'} +file={'./helpers.lua','./helpers','./internal'} dir='docs' readme='README.md' sort=true diff --git a/spec/helpers.lua b/spec/helpers.lua index 36e447091aad..fb6daffd9386 100644 --- a/spec/helpers.lua +++ b/spec/helpers.lua @@ -25,24 +25,24 @@ local luassert = require "luassert.assert" local uuid = require("kong.tools.uuid").uuid -local reload_module = require("spec.details.module").reload +local reload_module = require("spec.internal.module").reload log.set_lvl(log.levels.quiet) -- disable stdout logs in tests -- reload some modules when env or _G changes -local CONSTANTS = reload_module("spec.details.constants") -local conf = reload_module("spec.details.conf") -local shell = reload_module("spec.details.shell") -local misc = reload_module("spec.details.misc") -local DB = reload_module("spec.details.db") -local grpc = reload_module("spec.details.grpc") -local dns_mock = reload_module("spec.details.dns") -local asserts = reload_module("spec.details.asserts") -- luacheck: ignore -local pid = reload_module("spec.details.pid") -local cmd = reload_module("spec.details.cmd") -local server = reload_module("spec.details.server") +local CONSTANTS = reload_module("spec.internal.constants") +local conf = reload_module("spec.internal.conf") +local shell = reload_module("spec.internal.shell") +local misc = reload_module("spec.internal.misc") +local DB = reload_module("spec.internal.db") +local grpc = reload_module("spec.internal.grpc") +local dns_mock = reload_module("spec.internal.dns") +local asserts = reload_module("spec.internal.asserts") -- luacheck: ignore +local pid = reload_module("spec.internal.pid") +local cmd = reload_module("spec.internal.cmd") +local server = reload_module("spec.internal.server") local exec = shell.exec diff --git a/spec/details/asserts.lua b/spec/internal/asserts.lua similarity index 99% rename from spec/details/asserts.lua rename to spec/internal/asserts.lua index cfae28bb2140..2be65ae5bac7 100644 --- a/spec/details/asserts.lua +++ b/spec/internal/asserts.lua @@ -14,8 +14,8 @@ local colors = require("ansicolors") local luassert = require("luassert.assert") -local conf = require("spec.details.conf") -local misc = require("spec.details.misc") +local conf = require("spec.internal.conf") +local misc = require("spec.internal.misc") local strip = require("kong.tools.string").strip diff --git a/spec/details/cmd.lua b/spec/internal/cmd.lua similarity index 98% rename from spec/details/cmd.lua rename to spec/internal/cmd.lua index 2d7b2b1d6a61..9b9bf69c376d 100644 --- a/spec/details/cmd.lua +++ b/spec/internal/cmd.lua @@ -18,12 +18,12 @@ local kill = require("kong.cmd.utils.kill") local prefix_handler = require("kong.cmd.utils.prefix_handler") -local CONSTANTS = require("spec.details.constants") -local conf = require("spec.details.conf") -local shell = require("spec.details.shell") -local DB = require("spec.details.db") -local pid = require("spec.details.pid") -local dns_mock = require("spec.details.dns") +local CONSTANTS = require("spec.internal.constants") +local conf = require("spec.internal.conf") +local shell = require("spec.internal.shell") +local DB = require("spec.internal.db") +local pid = require("spec.internal.pid") +local dns_mock = require("spec.internal.dns") -- initialized in start_kong() diff --git a/spec/details/conf.lua b/spec/internal/conf.lua similarity index 69% rename from spec/details/conf.lua rename to spec/internal/conf.lua index d524d44fcdae..e2f32c513b96 100644 --- a/spec/details/conf.lua +++ b/spec/internal/conf.lua @@ -1,4 +1,4 @@ -local CONSTANTS = require("spec.details.constants") +local CONSTANTS = require("spec.internal.constants") local conf_loader = require("kong.conf_loader") diff --git a/spec/details/constants.lua b/spec/internal/constants.lua similarity index 100% rename from spec/details/constants.lua rename to spec/internal/constants.lua diff --git a/spec/details/db.lua b/spec/internal/db.lua similarity index 99% rename from spec/details/db.lua rename to spec/internal/db.lua index 6c45393da57c..913523f335f5 100644 --- a/spec/details/db.lua +++ b/spec/internal/db.lua @@ -24,7 +24,7 @@ local PLUGINS_LIST -- Add to package path so dao helpers can insert custom plugins -- (while running from the busted environment) do - local CONSTANTS = require("spec.details.constants") + local CONSTANTS = require("spec.internal.constants") local paths = {} table.insert(paths, os.getenv("KONG_LUA_PACKAGE_PATH")) @@ -39,7 +39,7 @@ end -- Conf and DAO -- ------------ -local conf = require("spec.details.conf") +local conf = require("spec.internal.conf") _G.kong = kong_global.new() diff --git a/spec/details/dns.lua b/spec/internal/dns.lua similarity index 100% rename from spec/details/dns.lua rename to spec/internal/dns.lua diff --git a/spec/details/grpc.lua b/spec/internal/grpc.lua similarity index 97% rename from spec/details/grpc.lua rename to spec/internal/grpc.lua index c22d85f01478..8c49cbda6af8 100644 --- a/spec/details/grpc.lua +++ b/spec/internal/grpc.lua @@ -3,7 +3,7 @@ local shell = require("resty.shell") local resty_signal = require("resty.signal") -local CONSTANTS = require("spec.details.constants") +local CONSTANTS = require("spec.internal.constants") local function isnewer(path_a, path_b) diff --git a/spec/details/misc.lua b/spec/internal/misc.lua similarity index 98% rename from spec/details/misc.lua rename to spec/internal/misc.lua index 3cd97a91c6fa..fecc1e38f3c4 100644 --- a/spec/details/misc.lua +++ b/spec/internal/misc.lua @@ -13,10 +13,10 @@ local ffi = require("ffi") local pl_path = require("pl.path") local pkey = require("resty.openssl.pkey") local nginx_signals = require("kong.cmd.utils.nginx_signals") -local shell = require("spec.details.shell") +local shell = require("spec.internal.shell") -local CONSTANTS = require("spec.details.constants") +local CONSTANTS = require("spec.internal.constants") ffi.cdef [[ diff --git a/spec/details/module.lua b/spec/internal/module.lua similarity index 100% rename from spec/details/module.lua rename to spec/internal/module.lua diff --git a/spec/details/pid.lua b/spec/internal/pid.lua similarity index 96% rename from spec/details/pid.lua rename to spec/internal/pid.lua index 29fecfd2977c..2237ece88156 100644 --- a/spec/details/pid.lua +++ b/spec/internal/pid.lua @@ -9,7 +9,7 @@ local shell = require("resty.shell") -local CONSTANTS = require("spec.details.constants") +local CONSTANTS = require("spec.internal.constants") -- Reads the pid from a pid file and returns it, or nil + err diff --git a/spec/details/server.lua b/spec/internal/server.lua similarity index 98% rename from spec/details/server.lua rename to spec/internal/server.lua index 25f7c46e87d5..8c602dbd45e2 100644 --- a/spec/details/server.lua +++ b/spec/internal/server.lua @@ -6,7 +6,7 @@ -- @module spec.helpers -local CONSTANTS = require("spec.details.constants") +local CONSTANTS = require("spec.internal.constants") --- @@ -63,7 +63,7 @@ local function tcp_server(port, opts) end if opts.tls and handshake_done then - local ssl = require "spec.details.ssl" + local ssl = require "spec.internal.ssl" local params = { mode = "server", @@ -405,8 +405,8 @@ end local is_echo_server_ready, get_echo_server_received_data, echo_server_reset do - local shell = require("spec.details.shell") - local cmd = require("spec.details.cmd") + local shell = require("spec.internal.shell") + local cmd = require("spec.internal.cmd") -- Message id is maintained within echo server context and not -- needed for echo server user. diff --git a/spec/details/shell.lua b/spec/internal/shell.lua similarity index 97% rename from spec/details/shell.lua rename to spec/internal/shell.lua index 16904f6b2943..ffb33132ec53 100644 --- a/spec/details/shell.lua +++ b/spec/internal/shell.lua @@ -10,8 +10,8 @@ local shell = require("resty.shell") local strip = require("kong.tools.string").strip -local CONSTANTS = require("spec.details.constants") -local conf = require("spec.details.conf") +local CONSTANTS = require("spec.internal.constants") +local conf = require("spec.internal.conf") ---------------- diff --git a/spec/details/ssl.lua b/spec/internal/ssl.lua similarity index 100% rename from spec/details/ssl.lua rename to spec/internal/ssl.lua