BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b7d6bb97
Unverified
Commit
b7d6bb97
authored
Jun 05, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that old API v1 generates still the same output
parent
c70e9f2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
entities.rb
lib/ci/api/entities.rb
+19
-1
builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+12
-0
No files found.
lib/ci/api/entities.rb
View file @
b7d6bb97
...
...
@@ -45,7 +45,25 @@ module Ci
expose
:artifacts_expire_at
,
if:
->
(
build
,
_
)
{
build
.
artifacts?
}
expose
:options
do
|
model
|
model
.
options
options
=
model
.
options
# This part ensures that output of old API is still the same after adding support
# for extended docker configuration options, used by new API
#
# I'm leaving this here, not in the model, because it should be removed at the same time
# when old API will be removed (planned for August 2017).
options
[
:image
]
=
options
[
:image
][
:name
]
if
options
[
:image
].
present?
&&
options
[
:image
].
is_a?
(
Hash
)
if
options
[
:services
].
present?
options
[
:services
].
map!
do
|
service
|
if
service
.
is_a?
(
Hash
)
service
[
:name
]
else
service
end
end
end
options
end
expose
:timeout
do
|
model
|
...
...
spec/requests/ci/api/builds_spec.rb
View file @
b7d6bb97
...
...
@@ -137,6 +137,18 @@ describe Ci::API::Builds do
end
end
end
context
'when docker configuration options are used'
do
let!
(
:build
)
{
create
(
:ci_build
,
:extended_options
,
pipeline:
pipeline
,
name:
'spinach'
,
stage:
'test'
,
stage_idx:
0
)
}
it
'starts a build'
do
register_builds
info:
{
platform: :darwin
}
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'options'
][
'image'
]).
to
eq
(
'ruby:2.1'
)
expect
(
json_response
[
'options'
][
'services'
]).
to
eq
([
'postgres'
,
'docker:dind'
])
end
end
end
context
'when builds are finished'
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