commit dc5edaa4ce5f75a3d2d69fef40c3c226ef7d12a4 from: Pavel Balaev via: Yaroslav Lobankov date: Tue Oct 17 11:12:49 2023 UTC tarantoolctl: fix luarocks warnings issue This patch fixes issue: $ tarantoolctl rocks --version 1>/dev/null Warning: failed to load command module luarocks.cmd.help NO_DOC=bugfix NO_CHANGELOG=not released yet (cherry picked from commit d6ae403e99cc20d816e59f8fba8f7350e44b9217) commit - 6bb09cecb3e598c98ba7f9d724a18bd07190d35a commit + dc5edaa4ce5f75a3d2d69fef40c3c226ef7d12a4 blob - b093fd907dddcfaf8ae820a1cc313ef29ce8ba5b blob + 2e1985092e5c2691e5f1f6f508c40b3e40b6bd8b --- extra/dist/tarantoolctl.in +++ extra/dist/tarantoolctl.in @@ -958,7 +958,7 @@ local function rocks() config = "luarocks.cmd.config", doc = "luarocks.cmd.doc", download = "luarocks.cmd.download", - help = "luarocks.cmd.help", + help = pcall(require, "luarocks.cmd.help") and "luarocks.cmd.help" or nil, init = "luarocks.cmd.init", install = "luarocks.cmd.install", lint = "luarocks.cmd.lint", blob - c2c41cb7c2fda17c39a1946f7759ff9158e77545 blob + ff2f80db723248d38cff732fffdaa1ad610d763b --- test/app-tap/tarantoolctl.test.lua +++ test/app-tap/tarantoolctl.test.lua @@ -176,7 +176,7 @@ local function merge(...) end local test = tap.test('tarantoolctl') -test:plan(8) +test:plan(9) -- basic start/stop test -- must be stopped afterwards @@ -352,6 +352,18 @@ do test_help(test_i, nil, "tarantoolctl --help", "Usage:") test_help(test_i, dir, "tarantoolctl", "Usage:") check_ok(test_i, dir, "rocks", "--help", 0, "Usage:") + end) + test:test("check no luarocks warnings issues", function(test_i) + test_i:plan(1) + local _, _, stderr = tctl_command(dir, "rocks", "--version") + local warnings = 0 + for _, line in pairs(string.split(stderr, '\n')) do + if line:match('[Ww]arning:') then + warnings = warnings + 1 + end + end + + test_i:is(warnings, 0, 'no warnings issued') end) end)