summaryrefslogtreecommitdiff
path: root/spec/services/ci/pipeline_processing
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 21:09:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-14 21:09:08 +0000
commit866ca4e49ff74ffadf8e6f6ff663a168489c2aba (patch)
treecc3135b1bae11dbd1cb3a30cb547473ad89a5551 /spec/services/ci/pipeline_processing
parent26a50872e9da9509c52c70f74dc21698fec906db (diff)
downloadgitlab-ce-866ca4e49ff74ffadf8e6f6ff663a168489c2aba.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/ci/pipeline_processing')
-rw-r--r--spec/services/ci/pipeline_processing/shared_processing_service.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/ci/pipeline_processing/shared_processing_service.rb b/spec/services/ci/pipeline_processing/shared_processing_service.rb
index 2349dedf370..ca003299535 100644
--- a/spec/services/ci/pipeline_processing/shared_processing_service.rb
+++ b/spec/services/ci/pipeline_processing/shared_processing_service.rb
@@ -880,6 +880,31 @@ shared_examples 'Pipeline Processing Service' do
end
end
+ context 'when a needed job is skipped', :sidekiq_inline do
+ let!(:linux_build) { create_build('linux:build', stage: 'build', stage_idx: 0) }
+ let!(:linux_rspec) { create_build('linux:rspec', stage: 'test', stage_idx: 1) }
+ let!(:deploy) do
+ create_build('deploy', stage: 'deploy', stage_idx: 2, scheduling_type: :dag, needs: [
+ create(:ci_build_need, name: 'linux:rspec')
+ ])
+ end
+
+ it 'skips the jobs depending on it' do
+ expect(process_pipeline).to be_truthy
+
+ expect(stages).to eq(%w(pending created created))
+ expect(all_builds.pending).to contain_exactly(linux_build)
+
+ linux_build.reset.drop!
+
+ expect(stages).to eq(%w(failed skipped skipped))
+ expect(all_builds.failed).to contain_exactly(linux_build)
+ expect(all_builds.skipped).to contain_exactly(linux_rspec, deploy)
+ end
+ end
+
+ private
+
def all_builds
pipeline.builds.order(:stage_idx, :id)
end