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
Jérome Perrin
gitlab-ce
Commits
626cb8ed
Commit
626cb8ed
authored
7 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix invalid conditional in pipeline create service
parent
fe0b2f81
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+1
-1
spec/lib/gitlab/ci/stage/seed_spec.rb
spec/lib/gitlab/ci/stage/seed_spec.rb
+1
-2
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+3
-2
No files found.
app/services/ci/create_pipeline_service.rb
View file @
626cb8ed
...
@@ -42,7 +42,7 @@ module Ci
...
@@ -42,7 +42,7 @@ module Ci
return
pipeline
return
pipeline
end
end
if
pipeline
.
has_stage_seeds?
unless
pipeline
.
has_stage_seeds?
return
error
(
'No stages / jobs for this pipeline.'
)
return
error
(
'No stages / jobs for this pipeline.'
)
end
end
...
...
This diff is collapsed.
Click to expand it.
spec/lib/gitlab/ci/stage/seed_spec.rb
View file @
626cb8ed
...
@@ -21,10 +21,9 @@ describe Gitlab::Ci::Stage::Seed do
...
@@ -21,10 +21,9 @@ describe Gitlab::Ci::Stage::Seed do
describe
'#builds'
do
describe
'#builds'
do
it
'returns hash attributes of all builds'
do
it
'returns hash attributes of all builds'
do
expect
(
subject
.
builds
.
size
).
to
eq
2
expect
(
subject
.
builds
.
size
).
to
eq
2
expect
(
subject
.
builds
).
to
all
(
include
(
pipeline:
pipeline
))
expect
(
subject
.
builds
).
to
all
(
include
(
project:
pipeline
.
project
))
expect
(
subject
.
builds
).
to
all
(
include
(
ref:
'master'
))
expect
(
subject
.
builds
).
to
all
(
include
(
ref:
'master'
))
expect
(
subject
.
builds
).
to
all
(
include
(
tag:
false
))
expect
(
subject
.
builds
).
to
all
(
include
(
tag:
false
))
expect
(
subject
.
builds
).
to
all
(
include
(
project:
pipeline
.
project
))
expect
(
subject
.
builds
)
expect
(
subject
.
builds
)
.
to
all
(
include
(
trigger_request:
pipeline
.
trigger_requests
.
first
))
.
to
all
(
include
(
trigger_request:
pipeline
.
trigger_requests
.
first
))
end
end
...
...
This diff is collapsed.
Click to expand it.
spec/services/ci/create_pipeline_service_spec.rb
View file @
626cb8ed
...
@@ -9,10 +9,10 @@ describe Ci::CreatePipelineService, :services do
...
@@ -9,10 +9,10 @@ describe Ci::CreatePipelineService, :services do
end
end
describe
'#execute'
do
describe
'#execute'
do
def
execute_service
(
after:
project
.
commit
.
id
,
message:
'Message'
,
ref:
'refs/heads/master'
)
def
execute_service
(
after
_sha
:
project
.
commit
.
id
,
message:
'Message'
,
ref:
'refs/heads/master'
)
params
=
{
ref:
ref
,
params
=
{
ref:
ref
,
before:
'00000000'
,
before:
'00000000'
,
after:
after
,
after:
after
_sha
,
commits:
[{
message:
message
}]
}
commits:
[{
message:
message
}]
}
described_class
.
new
(
project
,
user
,
params
).
execute
described_class
.
new
(
project
,
user
,
params
).
execute
...
@@ -30,6 +30,7 @@ describe Ci::CreatePipelineService, :services do
...
@@ -30,6 +30,7 @@ describe Ci::CreatePipelineService, :services do
it
'creates a pipeline'
do
it
'creates a pipeline'
do
expect
(
pipeline
).
to
be_kind_of
(
Ci
::
Pipeline
)
expect
(
pipeline
).
to
be_kind_of
(
Ci
::
Pipeline
)
expect
(
pipeline
).
to
be_valid
expect
(
pipeline
).
to
be_valid
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
).
to
eq
(
project
.
pipelines
.
last
)
expect
(
pipeline
).
to
eq
(
project
.
pipelines
.
last
)
expect
(
pipeline
).
to
have_attributes
(
user:
user
)
expect
(
pipeline
).
to
have_attributes
(
user:
user
)
expect
(
pipeline
).
to
have_attributes
(
status:
'pending'
)
expect
(
pipeline
).
to
have_attributes
(
status:
'pending'
)
...
...
This diff is collapsed.
Click to expand it.
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