Skip to content

Commit 0d18b54

Browse files
test: fix integration with metrics 0.17.0+
In metrics 0.17.0 cartridge hotreload was migrated to metrics cartridge role. The role must be enabled if we want to work with metrics+cartridge features.
1 parent 1a03709 commit 0d18b54

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/entrypoint/srv_stats.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,21 @@ if crud_utils.is_cartridge_hotreload_supported() then
5151
roles_reload_allowed = true
5252
end
5353

54+
local is_metrics = pcall(require, 'metrics')
55+
local roles = {
56+
'cartridge.roles.crud-router',
57+
'cartridge.roles.crud-storage',
58+
'customers-storage',
59+
}
60+
if is_metrics then
61+
table.insert(roles, 'cartridge.roles.metrics')
62+
end
63+
5464
local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, {
5565
advertise_uri = 'localhost:3301',
5666
http_port = 8081,
5767
bucket_count = 3000,
58-
roles = {
59-
'cartridge.roles.crud-router',
60-
'cartridge.roles.crud-storage',
61-
'customers-storage',
62-
},
68+
roles = roles,
6369
roles_reload_allowed = roles_reload_allowed,
6470
})
6571

test/integration/stats_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ end
851851
-- https://github.com/tarantool/metrics/blob/fc5a67072340b12f983f09b7d383aca9e2f10cf1/test/utils.lua#L22-L31
852852
local function find_obs(metric_name, label_pairs, observations)
853853
for _, obs in pairs(observations) do
854-
local same_label_pairs = pcall(t.assert_equals, obs.label_pairs, label_pairs)
854+
local same_label_pairs = pcall(t.assert_covers, obs.label_pairs, label_pairs)
855855
if obs.metric_name == metric_name and same_label_pairs then
856856
return obs
857857
end

0 commit comments

Comments
 (0)