Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/bulk_imports/pipeline/runner_spec.rb')
-rw-r--r--spec/lib/bulk_imports/pipeline/runner_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/bulk_imports/pipeline/runner_spec.rb b/spec/lib/bulk_imports/pipeline/runner_spec.rb
index 58ec1d1afca..8c882c799ec 100644
--- a/spec/lib/bulk_imports/pipeline/runner_spec.rb
+++ b/spec/lib/bulk_imports/pipeline/runner_spec.rb
@@ -39,7 +39,10 @@ RSpec.describe BulkImports::Pipeline::Runner do
end
it 'runs pipeline extractor, transformer, loader' do
- context = instance_double(BulkImports::Pipeline::Context)
+ context = instance_double(
+ BulkImports::Pipeline::Context,
+ entity: instance_double(BulkImports::Entity, id: 1, source_type: 'group')
+ )
entries = [{ foo: :bar }]
expect_next_instance_of(BulkImports::Extractor) do |extractor|
@@ -54,6 +57,17 @@ RSpec.describe BulkImports::Pipeline::Runner do
expect(loader).to receive(:load).with(context, entries.first)
end
+ expect_next_instance_of(Gitlab::Import::Logger) do |logger|
+ expect(logger).to receive(:info)
+ .with(message: "Pipeline started", pipeline: 'BulkImports::MyPipeline', entity: 1, entity_type: 'group')
+ expect(logger).to receive(:info)
+ .with(entity: 1, entity_type: 'group', extractor: 'BulkImports::Extractor')
+ expect(logger).to receive(:info)
+ .with(entity: 1, entity_type: 'group', transformer: 'BulkImports::Transformer')
+ expect(logger).to receive(:info)
+ .with(entity: 1, entity_type: 'group', loader: 'BulkImports::Loader')
+ end
+
BulkImports::MyPipeline.new.run(context)
end
end