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
4f837f66
Commit
4f837f66
authored
Aug 25, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove temporary stub method from ci config nodes
parent
eaf211c2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
26 deletions
+24
-26
lib/gitlab/ci/config/node/configurable.rb
lib/gitlab/ci/config/node/configurable.rb
+1
-1
lib/gitlab/ci/config/node/entry.rb
lib/gitlab/ci/config/node/entry.rb
+0
-6
lib/gitlab/ci/config/node/job.rb
lib/gitlab/ci/config/node/job.rb
+1
-1
spec/lib/gitlab/ci/config/node/cache_spec.rb
spec/lib/gitlab/ci/config/node/cache_spec.rb
+1
-1
spec/lib/gitlab/ci/config/node/global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+16
-10
spec/lib/gitlab/ci/config/node/job_spec.rb
spec/lib/gitlab/ci/config/node/job_spec.rb
+1
-1
spec/lib/gitlab/ci/config/node/jobs_spec.rb
spec/lib/gitlab/ci/config/node/jobs_spec.rb
+3
-3
spec/lib/gitlab/ci/config/node/script_spec.rb
spec/lib/gitlab/ci/config/node/script_spec.rb
+1
-3
No files found.
lib/gitlab/ci/config/node/configurable.rb
View file @
4f837f66
...
@@ -23,7 +23,7 @@ module Gitlab
...
@@ -23,7 +23,7 @@ module Gitlab
end
end
end
end
def
compose!
(
deps
)
def
compose!
(
deps
=
nil
)
return
unless
valid?
return
unless
valid?
self
.
class
.
nodes
.
each
do
|
key
,
factory
|
self
.
class
.
nodes
.
each
do
|
key
,
factory
|
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
4f837f66
...
@@ -20,12 +20,6 @@ module Gitlab
...
@@ -20,12 +20,6 @@ module Gitlab
@validator
.
validate
(
:new
)
@validator
.
validate
(
:new
)
end
end
# Temporary method
#
def
process!
(
deps
=
nil
)
compose!
(
deps
)
end
def
compose!
(
deps
=
nil
)
def
compose!
(
deps
=
nil
)
return
unless
valid?
return
unless
valid?
...
...
lib/gitlab/ci/config/node/job.rb
View file @
4f837f66
...
@@ -82,7 +82,7 @@ module Gitlab
...
@@ -82,7 +82,7 @@ module Gitlab
:cache
,
:image
,
:services
,
:only
,
:except
,
:variables
,
:cache
,
:image
,
:services
,
:only
,
:except
,
:variables
,
:artifacts
:artifacts
def
compose!
(
deps
)
def
compose!
(
deps
=
nil
)
super
do
super
do
if
type_defined?
&&
!
stage_defined?
if
type_defined?
&&
!
stage_defined?
@entries
[
:stage
]
=
@entries
[
:type
]
@entries
[
:stage
]
=
@entries
[
:type
]
...
...
spec/lib/gitlab/ci/config/node/cache_spec.rb
View file @
4f837f66
...
@@ -4,7 +4,7 @@ describe Gitlab::Ci::Config::Node::Cache do
...
@@ -4,7 +4,7 @@ describe Gitlab::Ci::Config::Node::Cache do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
describe
'validations'
do
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
context
'when entry config value is correct'
do
context
'when entry config value is correct'
do
let
(
:config
)
do
let
(
:config
)
do
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
4f837f66
...
@@ -27,8 +27,8 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -27,8 +27,8 @@ describe Gitlab::Ci::Config::Node::Global do
spinach:
{
script:
'spinach'
}
}
spinach:
{
script:
'spinach'
}
}
end
end
describe
'#
process
!'
do
describe
'#
compose
!'
do
before
{
global
.
process
!
}
before
{
global
.
compose
!
}
it
'creates nodes hash'
do
it
'creates nodes hash'
do
expect
(
global
.
descendants
).
to
be_an
Array
expect
(
global
.
descendants
).
to
be_an
Array
...
@@ -59,7 +59,7 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -59,7 +59,7 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
end
end
context
'when not
proces
sed'
do
context
'when not
compo
sed'
do
describe
'#before_script'
do
describe
'#before_script'
do
it
'returns nil'
do
it
'returns nil'
do
expect
(
global
.
before_script
).
to
be
nil
expect
(
global
.
before_script
).
to
be
nil
...
@@ -73,8 +73,8 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -73,8 +73,8 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
end
end
context
'when
proces
sed'
do
context
'when
compo
sed'
do
before
{
global
.
process
!
}
before
{
global
.
compose
!
}
describe
'#before_script'
do
describe
'#before_script'
do
it
'returns correct script'
do
it
'returns correct script'
do
...
@@ -148,8 +148,11 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -148,8 +148,11 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
context
'when most of entires not defined'
do
context
'when most of entires not defined'
do
let
(
:hash
)
{
{
cache:
{
key:
'a'
},
rspec:
{
script:
%w[ls]
}
}
}
before
{
global
.
compose!
}
before
{
global
.
process!
}
let
(
:hash
)
do
{
cache:
{
key:
'a'
},
rspec:
{
script:
%w[ls]
}
}
end
describe
'#nodes'
do
describe
'#nodes'
do
it
'instantizes all nodes'
do
it
'instantizes all nodes'
do
...
@@ -188,8 +191,11 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -188,8 +191,11 @@ describe Gitlab::Ci::Config::Node::Global do
# details.
# details.
#
#
context
'when entires specified but not defined'
do
context
'when entires specified but not defined'
do
let
(
:hash
)
{
{
variables:
nil
,
rspec:
{
script:
'rspec'
}
}
}
before
{
global
.
compose!
}
before
{
global
.
process!
}
let
(
:hash
)
do
{
variables:
nil
,
rspec:
{
script:
'rspec'
}
}
end
describe
'#variables'
do
describe
'#variables'
do
it
'undefined entry returns a default value'
do
it
'undefined entry returns a default value'
do
...
@@ -200,7 +206,7 @@ describe Gitlab::Ci::Config::Node::Global do
...
@@ -200,7 +206,7 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
context
'when hash is not valid'
do
context
'when hash is not valid'
do
before
{
global
.
process
!
}
before
{
global
.
compose
!
}
let
(
:hash
)
do
let
(
:hash
)
do
{
before_script:
'ls'
}
{
before_script:
'ls'
}
...
...
spec/lib/gitlab/ci/config/node/job_spec.rb
View file @
4f837f66
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Job
do
describe
Gitlab
::
Ci
::
Config
::
Node
::
Job
do
let
(
:entry
)
{
described_class
.
new
(
config
,
name: :rspec
)
}
let
(
:entry
)
{
described_class
.
new
(
config
,
name: :rspec
)
}
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
describe
'validations'
do
describe
'validations'
do
context
'when entry config value is correct'
do
context
'when entry config value is correct'
do
...
...
spec/lib/gitlab/ci/config/node/jobs_spec.rb
View file @
4f837f66
...
@@ -4,7 +4,7 @@ describe Gitlab::Ci::Config::Node::Jobs do
...
@@ -4,7 +4,7 @@ describe Gitlab::Ci::Config::Node::Jobs do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
describe
'validations'
do
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
context
'when entry config value is correct'
do
context
'when entry config value is correct'
do
let
(
:config
)
{
{
rspec:
{
script:
'rspec'
}
}
}
let
(
:config
)
{
{
rspec:
{
script:
'rspec'
}
}
}
...
@@ -47,8 +47,8 @@ describe Gitlab::Ci::Config::Node::Jobs do
...
@@ -47,8 +47,8 @@ describe Gitlab::Ci::Config::Node::Jobs do
end
end
end
end
context
'when valid job entries
proces
sed'
do
context
'when valid job entries
compo
sed'
do
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
let
(
:config
)
do
let
(
:config
)
do
{
rspec:
{
script:
'rspec'
},
{
rspec:
{
script:
'rspec'
},
...
...
spec/lib/gitlab/ci/config/node/script_spec.rb
View file @
4f837f66
...
@@ -3,9 +3,7 @@ require 'spec_helper'
...
@@ -3,9 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Script
do
describe
Gitlab
::
Ci
::
Config
::
Node
::
Script
do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'#process!'
do
describe
'validations'
do
before
{
entry
.
process!
}
context
'when entry config value is correct'
do
context
'when entry config value is correct'
do
let
(
:config
)
{
[
'ls'
,
'pwd'
]
}
let
(
:config
)
{
[
'ls'
,
'pwd'
]
}
...
...
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