Commit 5923741f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove references to global entry in new CI config

parent 3e16b015
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
class InvalidError < StandardError; end class InvalidError < StandardError; end
attr_reader :config, :attributes attr_reader :config, :attributes
attr_accessor :key, :parent, :global, :description attr_accessor :key, :parent, :description
def initialize(config, **attributes) def initialize(config, **attributes)
@config = config @config = config
......
...@@ -63,7 +63,6 @@ module Gitlab ...@@ -63,7 +63,6 @@ module Gitlab
node.new(value).tap do |entry| node.new(value).tap do |entry|
entry.key = @attributes[:key] entry.key = @attributes[:key]
entry.parent = @attributes[:parent] || @parent entry.parent = @attributes[:parent] || @parent
entry.global = @attributes[:global] || @parent.global
entry.description = @attributes[:description] entry.description = @attributes[:description]
end end
end end
......
...@@ -5,11 +5,6 @@ describe Gitlab::Ci::Config::Node::Factory do ...@@ -5,11 +5,6 @@ describe Gitlab::Ci::Config::Node::Factory do
let(:factory) { described_class.new(node) } let(:factory) { described_class.new(node) }
let(:node) { Gitlab::Ci::Config::Node::Script } let(:node) { Gitlab::Ci::Config::Node::Script }
let(:parent) { double('parent') } let(:parent) { double('parent') }
let(:global) { double('global') }
before do
allow(parent).to receive(:global).and_return(global)
end
context 'when setting a concrete value' do context 'when setting a concrete value' do
it 'creates entry with valid value' do it 'creates entry with valid value' do
...@@ -21,13 +16,12 @@ describe Gitlab::Ci::Config::Node::Factory do ...@@ -21,13 +16,12 @@ describe Gitlab::Ci::Config::Node::Factory do
expect(entry.value).to eq ['ls', 'pwd'] expect(entry.value).to eq ['ls', 'pwd']
end end
it 'sets parent and global attributes' do it 'sets parent attributes' do
entry = factory entry = factory
.value('ls') .value('ls')
.parent(parent) .parent(parent)
.create! .create!
expect(entry.global).to eq global
expect(entry.parent).to eq parent expect(entry.parent).to eq parent
end end
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Config::Node::Job do describe Gitlab::Ci::Config::Node::Job do
let(:entry) { described_class.new(config, attributes) } let(:entry) { described_class.new(config, key: :rspec) }
let(:attributes) { { key: :rspec, global: global } }
let(:global) { double('global', stages: %w[test]) }
before do before do
entry.process! entry.process!
...@@ -21,7 +19,7 @@ describe Gitlab::Ci::Config::Node::Job do ...@@ -21,7 +19,7 @@ describe Gitlab::Ci::Config::Node::Job do
end end
context 'when job name is empty' do context 'when job name is empty' do
let(:attributes) { { key: '', global: global } } let(:entry) { described_class.new(config, key: ''.to_sym) }
it 'reports error' do it 'reports error' do
expect(entry.errors) expect(entry.errors)
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Config::Node::Jobs do describe Gitlab::Ci::Config::Node::Jobs do
let(:entry) { described_class.new(config, global: global) } let(:entry) { described_class.new(config) }
let(:global) { double('global', before_script: nil, stages: %w[test]) }
describe 'validations' do describe 'validations' do
before do before do
......
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