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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6ad0c9e0
Commit
6ad0c9e0
authored
Dec 31, 2019
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make jobs with resource group cancellable
parent
7809db0c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletion
+27
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
changelogs/unreleased/make-resource-grouped-job-cancellable.yml
...logs/unreleased/make-resource-grouped-job-cancellable.yml
+5
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+15
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+6
-0
No files found.
app/models/concerns/has_status.rb
View file @
6ad0c9e0
...
...
@@ -7,7 +7,7 @@ module HasStatus
BLOCKED_STATUS
=
%w[manual scheduled]
.
freeze
AVAILABLE_STATUSES
=
%w[created waiting_for_resource preparing pending running success failed canceled skipped manual scheduled]
.
freeze
STARTED_STATUSES
=
%w[running success failed skipped manual scheduled]
.
freeze
ACTIVE_STATUSES
=
%w[preparing pending running]
.
freeze
ACTIVE_STATUSES
=
%w[
waiting_for_resource
preparing pending running]
.
freeze
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
.
freeze
ORDERED_STATUSES
=
%w[failed preparing pending running waiting_for_resource manual scheduled canceled success skipped created]
.
freeze
PASSED_WITH_WARNINGS_STATUSES
=
%w[failed canceled]
.
to_set
.
freeze
...
...
changelogs/unreleased/make-resource-grouped-job-cancellable.yml
0 → 100644
View file @
6ad0c9e0
---
title
:
Make jobs with resource group cancellable
merge_request
:
22356
author
:
type
:
fixed
spec/features/projects/jobs_spec.rb
View file @
6ad0c9e0
...
...
@@ -306,6 +306,21 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
context
'when job is waiting for resource'
,
:js
do
let
(
:job
)
{
create
(
:ci_build
,
:waiting_for_resource
,
pipeline:
pipeline
,
resource_group:
resource_group
)
}
let
(
:resource_group
)
{
create
(
:ci_resource_group
,
project:
project
)
}
before
do
visit
project_job_path
(
project
,
job
)
wait_for_requests
end
it
'shows correct UI components'
do
expect
(
page
).
to
have_content
(
"This job is waiting for resource:
#{
resource_group
.
key
}
"
)
expect
(
page
).
to
have_link
(
"Cancel this job"
)
end
end
context
"Job from other project"
do
before
do
visit
project_job_path
(
project
,
job2
)
...
...
spec/models/ci/build_spec.rb
View file @
6ad0c9e0
...
...
@@ -1610,6 +1610,12 @@ describe Ci::Build do
it
{
is_expected
.
to
be_cancelable
}
end
context
'when build is waiting for resource'
do
let
(
:build
)
{
create
(
:ci_build
,
:waiting_for_resource
)
}
it
{
is_expected
.
to
be_cancelable
}
end
end
context
'when build is not cancelable'
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