Skip to content
Snippets Groups Projects
Commit 309c0208 authored by Yaroslav Lobankov's avatar Yaroslav Lobankov Committed by Yaroslav Lobankov
Browse files

test: use luatest modules instead of internal ones

Some internal modules have been recently copied to luatest repo [1,2,3]
and now they can be safely removed, and the corresponding functionality
from luatest can be used instead.

Affected modules:

- test/luatest_helpers/misc.lua
- test/luatest_helpers/fiber.lua
- test/luatest_helpers/proxy/*

[1] https://github.com/tarantool/luatest/pull/247
[2] https://github.com/tarantool/luatest/pull/248
[3] https://github.com/tarantool/luatest/pull/255

Closes tarantool/luatest#238
Closes tarantool/luatest#251

NO_DOC=testing stuff
NO_TEST=testing stuff
NO_CHANGELOG=testing stuff

(cherry picked from commit 54bd77ad)
parent b0deee15
No related branches found
No related tags found
No related merge requests found
local misc = require('test.luatest_helpers.misc')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
......@@ -17,7 +16,7 @@ g.after_all(function(cg)
end)
g.test_invalid_compression_type_during_space_creation = function(cg)
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
cg.server:exec(function(engine, compression)
local t = require('luatest')
local format = {{
......@@ -36,7 +35,7 @@ g.before_test('test_invalid_compression_type_during_setting_format', function(cg
end)
g.test_invalid_compression_type_during_setting_format = function(cg)
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
cg.server:exec(function(compression)
local t = require('luatest')
local format = {{
......
local misc = require('test.luatest_helpers.misc')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
local g = t.group()
......@@ -63,7 +62,7 @@ end
-- Checks session and user in box.on_rollback trigger callback in case
-- transaction is rolled back on WAL error.
g.test_session_on_wal_error_rollback = function()
misc.skip_if_not_debug()
t.tarantool.skip_if_not_debug()
g.server:exec(function()
local t = require('luatest')
box.session.su('eve', function()
......
local misc = require('test.luatest_helpers.misc')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
......@@ -131,7 +130,7 @@ g.after_test('test_wal_error', function(cg)
end)
g.test_wal_error = function(cg)
misc.skip_if_not_debug()
t.tarantool.skip_if_not_debug()
cg.server:exec(function()
local t = require('luatest')
local function stat()
......
local misc = require('test.luatest_helpers.misc')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
local g = t.group()
......@@ -16,7 +15,7 @@ g.after_all = function()
end
g.test_low_level_api = function()
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
g.server:exec(function()
local t = require('luatest')
t.assert_error_msg_equals(
......@@ -27,7 +26,7 @@ g.test_low_level_api = function()
end
g.test_high_level_api = function()
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
g.server:exec(function()
local t = require('luatest')
t.assert_error_msg_equals(
......
local misc = require('test.luatest_helpers.misc')
local net = require('net.box')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
......@@ -48,7 +47,7 @@ g.test_net_box = function()
end
g.test_listen_ssl = function()
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
g.server:exec(function()
local t = require('luatest')
t.assert_error_msg_equals(
......@@ -58,7 +57,7 @@ g.test_listen_ssl = function()
end
g.test_replication_ssl = function()
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
g.server:exec(function()
local t = require('luatest')
t.assert_error_msg_equals(
......@@ -68,7 +67,7 @@ g.test_replication_ssl = function()
end
g.test_net_box_ssl = function()
misc.skip_if_enterprise()
t.tarantool.skip_if_enterprise()
t.assert_error_msg_equals(
'SSL is not available in this build',
net.connect, {g.server.net_box_uri, params = {transport = 'ssl'}})
......
local luatest = require('luatest')
local tarantool = require('tarantool')
-- Returns true if Tarantool build type is Debug.
local function is_debug_build()
return tarantool.build.target:endswith('-Debug')
end
-- Returns true if Tarantool package is Enterprise.
local function is_enterprise_package()
return tarantool.package == 'Tarantool Enterprise'
end
-- Skips a running test unless Tarantool build type is Debug.
local function skip_if_not_debug()
luatest.skip_if(not is_debug_build(), 'build type is not Debug')
end
-- Skips a running test if Tarantool package is Enterprise.
local function skip_if_enterprise()
luatest.skip_if(is_enterprise_package(), 'package is Enterprise')
end
return {
skip_if_not_debug = skip_if_not_debug,
skip_if_enterprise = skip_if_enterprise,
}
local misc = require('test.luatest_helpers.misc')
local server = require('test.luatest_helpers.server')
local t = require('luatest')
......@@ -28,7 +27,7 @@ end)
-- because it's in read view.
--
g.test_abort_yielding_dml = function(cg)
misc.skip_if_not_debug()
t.tarantool.skip_if_not_debug()
cg.server:exec(function()
local fiber = require('fiber')
local t = require('luatest')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment