Skip to content

Commit f5abe7a

Browse files
test: do not setup cartridge suite if unsupported
Before this patch, cartridge test suites were always set up with params and skipped if not supported. After this patch, test won't set it up at all if not supported. It reduces the quantity of useless info in test output.
1 parent f144d2f commit f5abe7a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

test/helper.lua

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,19 +826,33 @@ function helpers.extend_vshard_matrix(backend_params, backend_cfg_key, backend_c
826826
return backend_params
827827
end
828828

829+
function helpers.is_cartridge_suite_supported()
830+
local is_module_provided = pcall(require, 'cartridge')
831+
832+
local tarantool_version = luatest_utils.get_tarantool_version()
833+
local is_tarantool_supports = not luatest_utils.version_ge(tarantool_version,
834+
luatest_utils.version(3, 0, 0))
835+
return is_module_provided and is_tarantool_supports
836+
end
837+
829838
function helpers.backend_matrix(base_matrix)
830839
base_matrix = base_matrix or {{}}
831840
local backend_params = {
832-
{
833-
backend = helpers.backend.CARTRIDGE,
834-
backend_cfg = nil,
835-
},
836841
{
837842
backend = helpers.backend.VSHARD,
838843
backend_cfg = nil,
839844
},
840845
}
841846

847+
if helpers.is_cartridge_suite_supported() then
848+
table.insert(backend_params,
849+
{
850+
backend = helpers.backend.CARTRIDGE,
851+
backend_cfg = nil,
852+
}
853+
)
854+
end
855+
842856
if helpers.is_name_supported_as_vshard_id() then
843857
backend_params = helpers.extend_vshard_matrix(
844858
backend_params,

0 commit comments

Comments
 (0)