Commit 126d9399 authored by Kassio Borges's avatar Kassio Borges

BulkImports: Refactoring BulkImports::Stage specs

Changelog: other
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61616
parent f9c2ce53
...@@ -28,6 +28,8 @@ module EE ...@@ -28,6 +28,8 @@ module EE
} }
}.freeze }.freeze
private
override :config override :config
def config def config
@config ||= super.deep_merge(EE_CONFIG) @config ||= super.deep_merge(EE_CONFIG)
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'fast_spec_helper'
RSpec.describe BulkImports::Stage do RSpec.describe BulkImports::Stage do
let(:pipelines) do let(:pipelines) do
if Gitlab.ee?
[ [
[0, BulkImports::Groups::Pipelines::GroupPipeline], [0, BulkImports::Groups::Pipelines::GroupPipeline],
[1, BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline], [1, BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline],
[1, BulkImports::Groups::Pipelines::MembersPipeline], [1, BulkImports::Groups::Pipelines::MembersPipeline],
[1, BulkImports::Groups::Pipelines::LabelsPipeline], [1, BulkImports::Groups::Pipelines::LabelsPipeline],
[1, BulkImports::Groups::Pipelines::MilestonesPipeline], [1, BulkImports::Groups::Pipelines::MilestonesPipeline],
[1, BulkImports::Groups::Pipelines::BadgesPipeline], [1, BulkImports::Groups::Pipelines::BadgesPipeline]
[1, 'BulkImports::Groups::Pipelines::IterationsPipeline'.constantize],
[2, 'BulkImports::Groups::Pipelines::EpicsPipeline'.constantize],
[3, 'BulkImports::Groups::Pipelines::EpicAwardEmojiPipeline'.constantize],
[3, 'BulkImports::Groups::Pipelines::EpicEventsPipeline'.constantize],
[4, BulkImports::Groups::Pipelines::EntityFinisher]
] ]
else
[
[0, BulkImports::Groups::Pipelines::GroupPipeline],
[1, BulkImports::Groups::Pipelines::SubgroupEntitiesPipeline],
[1, BulkImports::Groups::Pipelines::MembersPipeline],
[1, BulkImports::Groups::Pipelines::LabelsPipeline],
[1, BulkImports::Groups::Pipelines::MilestonesPipeline],
[1, BulkImports::Groups::Pipelines::BadgesPipeline],
[2, BulkImports::Groups::Pipelines::EntityFinisher]
]
end
end end
describe '.pipelines' do describe '.pipelines' do
it 'list all the pipelines with their stage number, ordered by stage' do it 'list all the pipelines with their stage number, ordered by stage' do
expect(described_class.pipelines).to match_array(pipelines) expect(described_class.pipelines & pipelines).to eq(pipelines)
expect(described_class.pipelines.last.last).to eq(BulkImports::Groups::Pipelines::EntityFinisher)
end end
end end
......
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