Commit d18dad07 authored by Markus Koller's avatar Markus Koller

Merge branch 'deterministic-order-to-reviewer-table' into 'master'

Add deterministic ordering to roulette assignment table

See merge request gitlab-org/gitlab!48391
parents 453a5a4e a8e1958d
......@@ -24,7 +24,7 @@ module Gitlab
#
# @return [Array<Spin>]
def spin(project, categories, timezone_experiment: false)
spins = categories.map do |category|
spins = categories.sort.map do |category|
including_timezone = INCLUDE_TIMEZONE_FOR_CATEGORY.fetch(category, timezone_experiment)
spin_for_category(project, category, timezone_experiment: including_timezone)
......
......@@ -165,6 +165,14 @@ RSpec.describe Gitlab::Danger::Roulette do
end
end
context 'when change contains many categories' do
let(:categories) { [:frontend, :test, :qa, :engineering_productivity, :ci_template, :backend] }
it 'has a deterministic sorting order' do
expect(spins.map(&:category)).to eq categories.sort
end
end
context 'when change contains QA category' do
let(:categories) { [:qa] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment