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 13, 2023
1 parent 1bf3fbd commit 4a06457
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions test/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,18 @@ function helpers.complement_tuples_batch_with_operations(tuples, operations)
return tuples_operation_data
end

function helpers.is_metrics_0_12_0_or_older()
local metrics = require('metrics')

-- metrics 0.13.0 introduced VERSION, but it is likely to be deprecated in the future:
-- https://github.com/tarantool/metrics/commit/a7e666f50d23c3e1a11b9bc9882edddec2f4c67e
-- metrics 0.16.0 introduced _VERSION which is likely going to replace VERSION:
-- https://github.com/tarantool/metrics/commit/8f9b667f9db59ceff8e5d26e458244e2d67838da
if (metrics.VERSION == nil) and metrics._VERSION == nil then
return true
end

return false
end

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

pgroup.test_role_reload_do_not_reset_observations = function(g)
t.xfail_if(g.params.args.driver == 'metrics',
'See https://github.com/tarantool/metrics/issues/334')
t.skip_if((g.params.args.driver == 'metrics')
and helpers.is_metrics_0_12_0_or_older(),
"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_12_0_or_older(),
"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 4a06457

Please sign in to comment.