summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-01-23 07:42:14 +0000
committerLuke Bennett <lbennett@gitlab.com>2018-01-23 13:05:12 +0000
commit872eec831bc56bfdbe680974ee05c6034920b0de (patch)
treef4b102aa7cd27babd1abf718bca7837de3257a5a
parentf899ed43c122caa7284b17b8b40d3b9e3c5c3a7a (diff)
downloadgitlab-ce-872eec831bc56bfdbe680974ee05c6034920b0de.tar.gz
Merge branch '42119-non-triggered' into 'master'
Resolve ""This job has not been triggered yet" after hitting "Retry"" Closes #42119 See merge request gitlab-org/gitlab-ce!16583 (cherry picked from commit b472411efb238ae223f99ecda067fa22d25bf8bb) a1f7b2bc Do not render non triggered empty state for pending jobs 30cfcd5a Update tests 63b93664 Adds information for pending state 4b8004c7 Improve pending case test c414ab84 Improve copy for the pending state
-rw-r--r--app/views/projects/jobs/_empty_state.html.haml5
-rw-r--r--app/views/projects/jobs/show.html.haml10
-rw-r--r--spec/features/projects/jobs_spec.rb20
3 files changed, 27 insertions, 8 deletions
diff --git a/app/views/projects/jobs/_empty_state.html.haml b/app/views/projects/jobs/_empty_state.html.haml
index 311934d9c33..c66313bdbf3 100644
--- a/app/views/projects/jobs/_empty_state.html.haml
+++ b/app/views/projects/jobs/_empty_state.html.haml
@@ -1,7 +1,7 @@
- illustration = local_assigns.fetch(:illustration)
- illustration_size = local_assigns.fetch(:illustration_size)
- title = local_assigns.fetch(:title)
-- content = local_assigns.fetch(:content, nil)
+- content = local_assigns.fetch(:content)
- action = local_assigns.fetch(:action, nil)
.row.empty-state
@@ -11,8 +11,7 @@
.col-xs-12
.text-content
%h4.text-center= title
- - if content
- %p= content
+ %p= content
- if action
.text-center
= action
diff --git a/app/views/projects/jobs/show.html.haml b/app/views/projects/jobs/show.html.haml
index 1e6d6f67e66..eb0773f2d4e 100644
--- a/app/views/projects/jobs/show.html.haml
+++ b/app/views/projects/jobs/show.html.haml
@@ -95,12 +95,18 @@
title: _('This job requires a manual action'),
content: _('This job depends on a user to trigger its process. Often they are used to deploy code to production environments'),
action: ( link_to _('Trigger this manual action'), play_project_job_path(@project, @build), method: :post, class: 'btn btn-primary', title: _('Trigger this manual action') )
+ - elsif @build.created?
+ = render 'empty_state',
+ illustration: 'illustrations/job_not_triggered.svg',
+ illustration_size: 'svg-306',
+ title: _('This job has not been triggered yet'),
+ content: _('This job depends on upstream jobs that need to succeed in order for this job to be triggered')
- else
= render 'empty_state',
illustration: 'illustrations/job_not_triggered.svg',
illustration_size: 'svg-306',
- title: _('This job has not been triggered yet')
-
+ title: _('This job has not started yet'),
+ content: _('This job is in pending state and is waiting to be picked by a runner')
= render "sidebar"
.js-build-options{ data: javascript_build_options }
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index a5cd858b11a..e661db1809a 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -384,12 +384,12 @@ feature 'Jobs' do
expect(page).to have_link('Trigger this manual action')
end
- it 'plays manual action', :js do
+ it 'plays manual action and shows pending status', :js do
click_link 'Trigger this manual action'
wait_for_requests
- expect(page).to have_content('This job has not been triggered')
- expect(page).to have_content('This job is stuck, because the project doesn\'t have any runners online assigned to it.')
+ expect(page).to have_content('This job has not started yet')
+ expect(page).to have_content('This job is in pending state and is waiting to be picked by a runner')
expect(page).to have_content('pending')
end
end
@@ -403,6 +403,20 @@ feature 'Jobs' do
it 'shows empty state' do
expect(page).to have_content('This job has not been triggered yet')
+ expect(page).to have_content('This job depends on upstream jobs that need to succeed in order for this job to be triggered')
+ end
+ end
+
+ context 'Pending job' do
+ let(:job) { create(:ci_build, :pending, pipeline: pipeline) }
+
+ before do
+ visit project_job_path(project, job)
+ end
+
+ it 'shows pending empty state' do
+ expect(page).to have_content('This job has not started yet')
+ expect(page).to have_content('This job is in pending state and is waiting to be picked by a runner')
end
end
end