Skip to content

Commit

Permalink
test: conditional metrics roles reload skip
Browse files Browse the repository at this point in the history
Before this patch, tests were marked with xfail since there was a bug in
metrics module [1]. This bug is fixes in newer versions, so xfail is
replaced with skip based on metrics version.

1. tarantool/metrics#334

Follows #244
  • Loading branch information
DifferentialOrange committed Feb 3, 2023
1 parent 77ea64d commit f941611
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions test/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,21 @@ function helpers.complement_tuples_batch_with_operations(tuples, operations)
return tuples_operation_data
end

function helpers.is_metrics_0_13_0_or_newer()
local with_metrics, metrics = pcall(require, 'metrics')

if not with_metrics then
return false
end

-- 0.13.0: https://github.com/tarantool/metrics/commit/a7e666f50d23c3e1a11b9bc9882edddec2f4c67e
-- 0.16.0: https://github.com/tarantool/metrics/commit/8f9b667f9db59ceff8e5d26e458244e2d67838da

if metrics.VERSION ~= nil or metrics._VERSION ~= nil then
return true
end

return false
end

return helpers
6 changes: 4 additions & 2 deletions test/integration/stats_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ pgroup.before_test(
generate_stats)

pgroup.test_role_reload_do_not_reset_observations = function(g)
t.xfail_if(g.params.args.driver == 'metrics',
t.skip_if((g.params.args.driver == 'metrics')
and helpers.is_metrics_0_13_0_or_newer(),
'See https://github.com/tarantool/metrics/issues/334')

local stats_before = get_stats(g)
Expand Down Expand Up @@ -1084,7 +1085,8 @@ group_metrics.before_test(
generate_stats)

group_metrics.test_role_reload_do_not_reset_metrics_observations = function(g)
t.xfail('See https://github.com/tarantool/metrics/issues/334')
t.skip_if(helpers.is_metrics_0_13_0_or_newer(),
"See https://github.com/tarantool/metrics/issues/334")

helpers.reload_roles(g.cluster:server('router'))
g.router:eval("crud = require('crud')")
Expand Down

0 comments on commit f941611

Please sign in to comment.