Skip to content
Snippets Groups Projects
Commit 4f837f66 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Remove temporary stub method from ci config nodes

parent eaf211c2
No related branches found
No related tags found
1 merge request!6009Pass dependencies to CI configuration nodes
Pipeline #
Loading
Loading
@@ -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|
Loading
Loading
Loading
Loading
@@ -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?
 
Loading
Loading
Loading
Loading
@@ -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]
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -59,7 +59,7 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
 
context 'when not processed' do
context 'when not composed' do
describe '#before_script' do
it 'returns nil' do
expect(global.before_script).to be nil
Loading
Loading
@@ -73,8 +73,8 @@ describe Gitlab::Ci::Config::Node::Global do
end
end
 
context 'when processed' do
before { global.process! }
context 'when composed' do
before { global.compose! }
 
describe '#before_script' do
it 'returns correct script' do
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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' }
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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' } } }
Loading
Loading
@@ -47,8 +47,8 @@ describe Gitlab::Ci::Config::Node::Jobs do
end
end
 
context 'when valid job entries processed' do
before { entry.process! }
context 'when valid job entries composed' do
before { entry.compose! }
 
let(:config) do
{ rspec: { script: 'rspec' },
Loading
Loading
Loading
Loading
@@ -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'] }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment