Commit 50b001a2 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'kassio/bulkimports-refactoring-stage-tests' into 'master'

BulkImports: Refactoring BulkImports::Stage specs

See merge request gitlab-org/gitlab!61616
parents a332fbfb 126d9399
...@@ -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