Commit 4f837f66 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove temporary stub method from ci config nodes

parent eaf211c2
...@@ -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|
......
...@@ -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?
......
...@@ -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]
......
...@@ -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
......
...@@ -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 processed' do context 'when not composed' 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 processed' do context 'when composed' 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' }
......
...@@ -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
......
...@@ -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 processed' do context 'when valid job entries composed' do
before { entry.process! } before { entry.compose! }
let(:config) do let(:config) do
{ rspec: { script: 'rspec' }, { rspec: { script: 'rspec' },
......
...@@ -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'] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment