diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-05 22:37:28 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-12-06 15:53:59 +0900 |
commit | c3e0731d2efc777018b668d9e0b7f8aa2377d9fc (patch) | |
tree | fcfbec6c06c4a4052716120f58dd140363339ae0 /spec/services/ci | |
parent | 6e343b27bfb993b2c19dd4b4fd8d2b48747fbac3 (diff) | |
download | gitlab-ce-c3e0731d2efc777018b668d9e0b7f8aa2377d9fc.tar.gz |
Add case when artifacts have not existed on dependencies
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/register_job_service_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb index e779d02cc52..b5f88d6cdbe 100644 --- a/spec/services/ci/register_job_service_spec.rb +++ b/spec/services/ci/register_job_service_spec.rb @@ -291,6 +291,31 @@ module Ci it "picks the build" do expect(picked_job).to eq(pending_job) end + + context 'when "artifacts" keyword is specified on depended job' do + let!(:pre_stage_job) do + create(:ci_build, :success, :artifacts, pipeline: pipeline, name: job_name, stage_idx: 0, + options: { artifacts: { paths: ['binaries/'] } } ) + end + + context 'when artifacts of depended job has existsed' do + it "picks the build" do + expect(picked_job).to eq(pending_job) + end + end + + context 'when artifacts of depended job has not existsed' do + before do + pre_stage_job.erase_artifacts! + end + + it 'does not pick the build and drops the build' do + expect(picked_job).to be_nil + expect(pending_job.reload).to be_failed + expect(pending_job).to be_missing_dependency_failure + end + end + end end context 'when depended jobs do not exist' do |