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:
authorKamil TrzciƄski <ayufan@ayufan.eu>2019-08-01 17:26:49 +0300
committerSean McGivern <sean@gitlab.com>2019-08-01 17:26:49 +0300
commite7ee84aad4237eaa16f2aba75b4d2c7860625c9d (patch)
tree786c239cdf6568289f9b2df4dd1d85290c246b36 /spec/workers
parent2cf9769d12bb93c7a55432f8c8c08e89e6735461 (diff)
Add support for DAG
This implements the support for `needs:` keyword as part of GitLab CI. That makes some of the jobs to be run out of order.
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/build_process_worker_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/workers/build_process_worker_spec.rb b/spec/workers/build_process_worker_spec.rb
new file mode 100644
index 00000000000..cceca40717c
--- /dev/null
+++ b/spec/workers/build_process_worker_spec.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe BuildProcessWorker do
+ describe '#perform' do
+ context 'when build exists' do
+ let(:pipeline) { create(:ci_pipeline) }
+ let(:build) { create(:ci_build, pipeline: pipeline) }
+
+ it 'processes build' do
+ expect_any_instance_of(Ci::Pipeline).to receive(:process!)
+ .with(build.name)
+
+ described_class.new.perform(build.id)
+ end
+ end
+
+ context 'when build does not exist' do
+ it 'does not raise exception' do
+ expect { described_class.new.perform(123) }
+ .not_to raise_error
+ end
+ end
+ end
+end