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
760fd675
Commit
760fd675
authored
Oct 09, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flags for scheduled jobs in environments list
parent
6a5e7e7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
3 deletions
+67
-3
app/assets/javascripts/environments/components/environment_actions.vue
...vascripts/environments/components/environment_actions.vue
+1
-1
spec/features/projects/environments/environments_spec.rb
spec/features/projects/environments/environments_spec.rb
+66
-2
No files found.
app/assets/javascripts/environments/components/environment_actions.vue
View file @
760fd675
...
...
@@ -70,7 +70,7 @@ export default {
:aria-label=
"title"
:disabled=
"isLoading"
type=
"button"
class=
"dropdown btn btn-default dropdown-new js-
dropdown-play-icon-container
"
class=
"dropdown btn btn-default dropdown-new js-
environment-actions-dropdown
"
data-container=
"body"
data-toggle=
"dropdown"
>
...
...
spec/features/projects/environments/environments_spec.rb
View file @
760fd675
...
...
@@ -162,7 +162,7 @@ describe 'Environments page', :js do
end
it
'shows a play button'
do
find
(
'.js-
dropdown-play-icon-container
'
).
click
find
(
'.js-
environment-actions-dropdown
'
).
click
expect
(
page
).
to
have_content
(
action
.
name
.
humanize
)
end
...
...
@@ -170,7 +170,7 @@ describe 'Environments page', :js do
it
'allows to play a manual action'
,
:js
do
expect
(
action
).
to
be_manual
find
(
'.js-
dropdown-play-icon-container
'
).
click
find
(
'.js-
environment-actions-dropdown
'
).
click
expect
(
page
).
to
have_content
(
action
.
name
.
humanize
)
expect
{
find
(
'.js-manual-action-link'
).
click
}
...
...
@@ -260,6 +260,70 @@ describe 'Environments page', :js do
end
end
end
context
'when there is a delayed job'
do
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let!
(
:delayed_job
)
do
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
,
name:
'delayed job'
,
stage:
'test'
,
commands:
'test'
)
end
let!
(
:deployment
)
do
create
(
:deployment
,
environment:
environment
,
deployable:
build
,
sha:
project
.
commit
.
id
)
end
before
do
visit_environments
(
project
)
end
it
'has a dropdown for actionable jobs'
do
expect
(
page
).
to
have_selector
(
'.dropdown-new.btn.btn-default .ic-play'
)
end
it
"has link to the delayed job's action"
do
find
(
'.js-environment-actions-dropdown'
).
click
time_diff
=
[
0
,
delayed_job
.
scheduled_at
-
Time
.
now
].
max
expect
(
page
).
to
have_button
(
'Delayed job'
)
expect
(
page
).
to
have_content
(
Time
.
at
(
time_diff
).
utc
.
strftime
(
"%H:%M:%S"
))
end
context
'when delayed job is expired already'
do
let!
(
:delayed_job
)
do
create
(
:ci_build
,
:expired_scheduled
,
pipeline:
pipeline
,
name:
'delayed job'
,
stage:
'test'
,
commands:
'test'
)
end
it
"shows 00:00:00 as the remaining time"
do
find
(
'.js-environment-actions-dropdown'
).
click
expect
(
page
).
to
have_content
(
"00:00:00"
)
end
end
context
'when user played a delayed job immediately'
do
before
do
find
(
'.js-environment-actions-dropdown'
).
click
page
.
accept_confirm
{
click_button
(
'Delayed job'
)
}
wait_for_requests
end
it
'enqueues the delayed job'
,
:js
do
expect
(
delayed_job
.
reload
).
to
be_pending
end
end
end
end
end
...
...
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