Skip to content

Commit

Permalink
tests(helpers): rename directory details to internal (#13665)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored Sep 14, 2024
1 parent d4a2ccd commit 1c4b859
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion spec/config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/details/asserts.lua → spec/internal/asserts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/details/cmd.lua → spec/internal/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion spec/details/conf.lua → spec/internal/conf.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local CONSTANTS = require("spec.details.constants")
local CONSTANTS = require("spec.internal.constants")
local conf_loader = require("kong.conf_loader")


Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions spec/details/db.lua → spec/internal/db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/details/grpc.lua → spec/internal/grpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions spec/details/misc.lua → spec/internal/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/details/pid.lua → spec/internal/pid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/details/server.lua → spec/internal/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- @module spec.helpers


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


---
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions spec/details/shell.lua → spec/internal/shell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")


----------------
Expand Down
File renamed without changes.

1 comment on commit 1c4b859

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:1c4b859be73f716b8e6796868cc35a9eee7413ca
Artifacts available https://github.com/Kong/kong/actions/runs/10858440958

Please sign in to comment.