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
Léo-Paul Géneau
gitlab-ce
Commits
c1cc252b
Commit
c1cc252b
authored
Nov 25, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move helpers to the end of process pipeline specs
parent
fda61998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+29
-29
No files found.
spec/services/ci/process_pipeline_service_spec.rb
View file @
c1cc252b
...
...
@@ -10,22 +10,6 @@ describe Ci::ProcessPipelineService, services: true do
end
describe
'#execute'
do
def
all_builds
pipeline
.
builds
end
def
builds
all_builds
.
where
.
not
(
status:
[
:created
,
:skipped
])
end
def
process_pipeline
described_class
.
new
(
pipeline
.
project
,
user
).
execute
(
pipeline
)
end
def
succeed_pending
builds
.
pending
.
update_all
(
status:
'success'
)
end
context
'start queuing next builds'
do
before
do
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
'linux'
,
stage_idx:
0
)
...
...
@@ -223,10 +207,6 @@ describe Ci::ProcessPipelineService, services: true do
pipeline
.
builds
.
running_or_pending
.
each
(
&
:success
)
expect
(
manual_actions
).
to
be_many
# production and clear cache
end
def
manual_actions
pipeline
.
manual_actions
end
end
end
...
...
@@ -282,15 +262,6 @@ describe Ci::ProcessPipelineService, services: true do
expect
(
builds
.
map
(
&
:status
)).
to
eq
(
%w[success skipped pending]
)
end
end
def
create_build
(
name
,
stage_idx
,
when_value
=
nil
)
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
name
,
stage_idx:
stage_idx
,
when:
when_value
)
end
end
context
'when failed build in the middle stage is retried'
do
...
...
@@ -381,4 +352,33 @@ describe Ci::ProcessPipelineService, services: true do
end
end
end
def
all_builds
pipeline
.
builds
end
def
builds
all_builds
.
where
.
not
(
status:
[
:created
,
:skipped
])
end
def
process_pipeline
described_class
.
new
(
pipeline
.
project
,
user
).
execute
(
pipeline
)
end
def
succeed_pending
builds
.
pending
.
update_all
(
status:
'success'
)
end
def
manual_actions
pipeline
.
manual_actions
end
def
create_build
(
name
,
stage_idx
,
when_value
=
nil
)
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
name
,
stage_idx:
stage_idx
,
when:
when_value
)
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