diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-05 15:10:34 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-05 15:10:34 +0900 |
commit | 38d9b4d77d85e26f827ff9640243494adc8597ed (patch) | |
tree | 7052b5d25da7a793fe899967410f471d5e64f1ad /spec | |
parent | 5d50cbfaab1d67ffaea6064aeac848f1fc1127a6 (diff) | |
download | gitlab-ce-38d9b4d77d85e26f827ff9640243494adc8597ed.tar.gz |
Use script_failure. Add runner_system_failure. Improve spec.feature/sm/37239-implement-failure_reason-on-ci_builds
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/commit_status_spec.rb | 6 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 28 | ||||
-rw-r--r-- | spec/services/projects/update_pages_service_spec.rb | 2 |
3 files changed, 23 insertions, 13 deletions
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 0a6b0023dea..858ec831200 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -458,10 +458,10 @@ describe CommitStatus do it { is_expected.to be_unknown_failure } end - context 'when failure_reason is job_failure' do - let(:reason) { :job_failure } + context 'when failure_reason is script_failure' do + let(:reason) { :script_failure } - it { is_expected.to be_job_failure } + it { is_expected.to be_script_failure } end end end diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index f9dcd9d07cb..419a65c69b5 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -626,24 +626,34 @@ describe API::Runner do it 'mark job as succeeded' do update_job(state: 'success') - expect(job.reload.status).to eq 'success' - expect(job).to be_unknown_failure + job.reload + expect(job).to be_success end it 'mark job as failed' do update_job(state: 'failed') - expect(job.reload.status).to eq 'failed' - expect(job).to be_job_failure + job.reload + expect(job).to be_failed + expect(job).to be_unknown_failure end - context 'when failure_reason is given' do - it 'mark job as failed' do - update_job(state: 'failed', failure_reason: 'stuck_or_timeout_failure') + context 'when failure_reason is script_failure' do + before do + update_job(state: 'failed', failure_reason: 'script_failure') + job.reload + end + + it { expect(job).to be_script_failure } + end - expect(job.reload.status).to eq 'failed' - expect(job).to be_stuck_or_timeout_failure + context 'when failure_reason is runner_system_failure' do + before do + update_job(state: 'failed', failure_reason: 'runner_system_failure') + job.reload end + + it { expect(job).to be_runner_system_failure } end end diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb index 5fc69c7e4e5..031366d1825 100644 --- a/spec/services/projects/update_pages_service_spec.rb +++ b/spec/services/projects/update_pages_service_spec.rb @@ -116,7 +116,7 @@ describe Projects::UpdatePagesService do expect(deploy_status.description) .to match(/artifacts for pages are too large/) - expect(deploy_status).to be_job_failure + expect(deploy_status).to be_script_failure end end |