Skip to content

Commit

Permalink
chore(test) revert to regular busted, no more rbusted (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored Mar 9, 2021
1 parent 13f1442 commit 6b34b59
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
return {
default = {
lua = "spec/resty-runner.lua",
verbose = true,
coverage = false,
output = "gtest",
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ install:

script:
- luacheck ./src
- ./rbusted --lpath=`pwd`/src/?.lua ./spec/
- busted
27 changes: 27 additions & 0 deletions spec/resty-runner.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env resty

-- script to run Busted tests using Openresty while setting some extra flags.
--
-- This script should be specified as:
-- busted --lua=<this-file>
--
-- Alternatively specify it in the `.busted` config file


-- These flags are passed to `resty` by default, to allow for more connections
-- and disable the Global variable write-guard. Override it by setting the
-- environment variable `BUSTED_RESTY_FLAGS`.
local RESTY_FLAGS=os.getenv("BUSTED_RESTY_FLAGS") or "-c 4096 -e 'setmetatable(_G, nil)'"

-- rebuild the invoked commandline, while inserting extra resty-flags
local cmd = {
"exec",
arg[-1],
RESTY_FLAGS,
}
for i, param in ipairs(arg) do
table.insert(cmd, "'" .. param .. "'")
end

local _, _, rc = os.execute(table.concat(cmd, " "))
os.exit(rc)

0 comments on commit 6b34b59

Please sign in to comment.