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
Show 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
end
end
def
compose!
(
deps
)
def
compose!
(
deps
=
nil
)
return
unless
valid?
self
.
class
.
nodes
.
each
do
|
key
,
factory
|
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
4f837f66
...
...
@@ -20,12 +20,6 @@ module Gitlab
@validator
.
validate
(
:new
)
end
# Temporary method
#
def
process!
(
deps
=
nil
)
compose!
(
deps
)
end
def
compose!
(
deps
=
nil
)
return
unless
valid?
...
...
lib/gitlab/ci/config/node/job.rb
View file @
4f837f66
...
...
@@ -82,7 +82,7 @@ module Gitlab
:cache
,
:image
,
:services
,
:only
,
:except
,
:variables
,
:artifacts
def
compose!
(
deps
)
def
compose!
(
deps
=
nil
)
super
do
if
type_defined?
&&
!
stage_defined?
@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
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
context
'when entry config value is correct'
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
spinach:
{
script:
'spinach'
}
}
end
describe
'#
process
!'
do
before
{
global
.
process
!
}
describe
'#
compose
!'
do
before
{
global
.
compose
!
}
it
'creates nodes hash'
do
expect
(
global
.
descendants
).
to
be_an
Array
...
...
@@ -59,7 +59,7 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
context
'when not
proces
sed'
do
context
'when not
compo
sed'
do
describe
'#before_script'
do
it
'returns nil'
do
expect
(
global
.
before_script
).
to
be
nil
...
...
@@ -73,8 +73,8 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
context
'when
proces
sed'
do
before
{
global
.
process
!
}
context
'when
compo
sed'
do
before
{
global
.
compose
!
}
describe
'#before_script'
do
it
'returns correct script'
do
...
...
@@ -148,8 +148,11 @@ describe Gitlab::Ci::Config::Node::Global do
end
context
'when most of entires not defined'
do
let
(
:hash
)
{
{
cache:
{
key:
'a'
},
rspec:
{
script:
%w[ls]
}
}
}
before
{
global
.
process!
}
before
{
global
.
compose!
}
let
(
:hash
)
do
{
cache:
{
key:
'a'
},
rspec:
{
script:
%w[ls]
}
}
end
describe
'#nodes'
do
it
'instantizes all nodes'
do
...
...
@@ -188,8 +191,11 @@ describe Gitlab::Ci::Config::Node::Global do
# details.
#
context
'when entires specified but not defined'
do
let
(
:hash
)
{
{
variables:
nil
,
rspec:
{
script:
'rspec'
}
}
}
before
{
global
.
process!
}
before
{
global
.
compose!
}
let
(
:hash
)
do
{
variables:
nil
,
rspec:
{
script:
'rspec'
}
}
end
describe
'#variables'
do
it
'undefined entry returns a default value'
do
...
...
@@ -200,7 +206,7 @@ describe Gitlab::Ci::Config::Node::Global do
end
context
'when hash is not valid'
do
before
{
global
.
process
!
}
before
{
global
.
compose
!
}
let
(
:hash
)
do
{
before_script:
'ls'
}
...
...
spec/lib/gitlab/ci/config/node/job_spec.rb
View file @
4f837f66
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Job
do
let
(
:entry
)
{
described_class
.
new
(
config
,
name: :rspec
)
}
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
describe
'validations'
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
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
before
{
entry
.
process
!
}
before
{
entry
.
compose
!
}
context
'when entry config value is correct'
do
let
(
:config
)
{
{
rspec:
{
script:
'rspec'
}
}
}
...
...
@@ -47,8 +47,8 @@ describe Gitlab::Ci::Config::Node::Jobs do
end
end
context
'when valid job entries
proces
sed'
do
before
{
entry
.
process
!
}
context
'when valid job entries
compo
sed'
do
before
{
entry
.
compose
!
}
let
(
:config
)
do
{
rspec:
{
script:
'rspec'
},
...
...
spec/lib/gitlab/ci/config/node/script_spec.rb
View file @
4f837f66
...
...
@@ -3,9 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Script
do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'#process!'
do
before
{
entry
.
process!
}
describe
'validations'
do
context
'when entry config value is correct'
do
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