Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9621bbb9
Commit
9621bbb9
authored
Oct 03, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec
parent
1da4ae71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
0 deletions
+96
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+25
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+34
-0
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+37
-0
No files found.
spec/features/projects/jobs_spec.rb
View file @
9621bbb9
...
...
@@ -429,6 +429,31 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
context
'Delayed job'
do
let
(
:job
)
{
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
)
}
before
do
project
.
add_developer
(
user
)
visit
project_job_path
(
project
,
job
)
end
it
'shows delayed job'
do
expect
(
page
).
to
have_content
(
job
.
detailed_status
(
user
).
illustration
[
:title
])
expect
(
page
).
to
have_content
(
'This is a scheduled to run in'
)
expect
(
page
).
to
have_content
(
"This job will automatically run after it's timer finishes."
)
expect
(
page
).
to
have_link
(
'Unschedule job'
)
end
it
'unschedule delayed job and shows manual action'
,
:js
do
click_link
'Unschedule job'
wait_for_requests
expect
(
page
).
to
have_content
(
'This job requires a manual action'
)
expect
(
page
).
to
have_content
(
'This job depends on a user to trigger its process. Often they are used to deploy code to production environments'
)
expect
(
page
).
to
have_link
(
'Trigger this manual action'
)
end
end
context
'Non triggered job'
do
let
(
:job
)
{
create
(
:ci_build
,
:created
,
pipeline:
pipeline
)
}
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
9621bbb9
...
...
@@ -31,6 +31,11 @@ describe 'Pipeline', :js do
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual-build'
)
end
let!
(
:build_scheduled
)
do
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'delayed-job'
)
end
let!
(
:build_external
)
do
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
...
...
@@ -105,6 +110,25 @@ describe 'Pipeline', :js do
end
end
context
'when pipeline has scheduled builds'
do
it
'shows the scheduled icon and a unschedule action for the scheduled build'
do
page
.
within
(
'#ci-badge-delayed-job'
)
do
expect
(
page
).
to
have_selector
(
'.js-ci-status-icon-scheduled'
)
expect
(
page
).
to
have_content
(
'delayed-job'
)
end
page
.
within
(
'#ci-badge-delayed-job .ci-action-icon-container.js-icon-time-out'
)
do
expect
(
page
).
to
have_selector
(
'svg'
)
end
end
it
'should be possible to unschedule the scheduled job'
do
find
(
'#ci-badge-delayed-job .ci-action-icon-container'
).
click
expect
(
page
).
not_to
have_content
(
'Unschedule job'
)
end
end
context
'when pipeline has failed builds'
do
it
'shows the failed icon and a retry action for the failed build'
do
page
.
within
(
'#ci-badge-test'
)
do
...
...
@@ -315,6 +339,16 @@ describe 'Pipeline', :js do
it
{
expect
(
build_manual
.
reload
).
to
be_pending
}
end
context
'unscheduling scheduled job'
do
before
do
within
'.pipeline-holder'
do
click_link
(
'Unschedule'
)
end
end
it
{
expect
(
build_scheduled
.
reload
).
to
be_manual
}
end
context
'failed jobs'
do
it
'displays a tooltip with the failure reason'
do
page
.
within
(
'.ci-table'
)
do
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
9621bbb9
...
...
@@ -232,6 +232,43 @@ describe 'Pipelines', :js do
end
end
context
'with delayed job'
do
let!
(
:delayed_job
)
do
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
,
name:
'delayed job'
,
stage:
'test'
,
commands:
'test'
)
end
before
do
visit_project_pipelines
end
it
'has a dropdown with play button'
do
expect
(
page
).
to
have_selector
(
'.dropdown-new.btn.btn-default .icon-play'
)
end
it
'has link to the scheduled action'
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
expect
(
page
).
to
have_button
(
'delayed job'
)
end
context
'when scheduled action was played'
do
before
do
accept_confirm
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
click_button
(
'delayed job'
)
end
end
it
'enqueues scheduled action job'
do
expect
(
page
).
to
have_selector
(
'.js-pipeline-dropdown-manual-actions:disabled'
)
end
end
end
context
'for generic statuses'
do
context
'when running'
do
let!
(
:running
)
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment