Skip to content

Sandbox unit.cfg_errors test #1285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/helper.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
require('strict').on()

local fio = require('fio')
local checks = require('checks')
local digest = require('digest')
local helpers = table.copy(require('cartridge.test-helpers'))
local utils = require('cartridge.utils')

local errno = require('errno')
local errno_list = getmetatable(errno).__index
Expand Down Expand Up @@ -154,4 +156,20 @@ function helpers.random_cookie()
return digest.urandom(6):hex()
end

function helpers.run_remotely(srv, fn)
checks('table', 'function')
utils.assert_upvalues(fn, {})

local ok, ret = srv.net_box:eval([[
local fn = loadstring(...)
return pcall(fn)
]], {string.dump(fn)})

if not ok then
error(ret, 0)
end

return ret
end

return helpers
Loading