Commit 149f67cc authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove coverage entry from global CI/CD options

parent 8a333d45
...@@ -33,11 +33,8 @@ module Gitlab ...@@ -33,11 +33,8 @@ module Gitlab
entry :cache, Entry::Cache, entry :cache, Entry::Cache,
description: 'Configure caching between build jobs.' description: 'Configure caching between build jobs.'
entry :coverage, Entry::Coverage,
description: 'Coverage configuration for this pipeline.'
helpers :before_script, :image, :services, :after_script, helpers :before_script, :image, :services, :after_script,
:variables, :stages, :types, :cache, :coverage, :jobs :variables, :stages, :types, :cache, :jobs
def compose!(_deps = nil) def compose!(_deps = nil)
super(self) do super(self) do
......
...@@ -5,27 +5,18 @@ module Ci ...@@ -5,27 +5,18 @@ module Ci
let(:path) { 'path' } let(:path) { 'path' }
describe '#build_attributes' do describe '#build_attributes' do
context 'Coverage entry' do describe 'coverage entry' do
subject { described_class.new(config, path).build_attributes(:rspec) } subject { described_class.new(config, path).build_attributes(:rspec) }
let(:config_base) { { rspec: { script: "rspec" } } } describe 'code coverage regexp' do
let(:config) { YAML.dump(config_base) } let(:config) do
YAML.dump(rspec: { script: 'rspec',
context 'when config has coverage set at the global scope' do coverage: '/Code coverage: \d+\.\d+/'})
before do
config_base.update(coverage: '/\(\d+\.\d+\) covered/')
end
context "and 'rspec' job doesn't have coverage set" do
it { is_expected.to include(coverage_regex: '\(\d+\.\d+\) covered') }
end
context "but 'rspec' job also has coverage set" do
before do
config_base[:rspec][:coverage] = '/Code coverage: \d+\.\d+/'
end end
it { is_expected.to include(coverage_regex: 'Code coverage: \d+\.\d+') } it 'includes coverage regexp in build attributes' do
expect(subject)
.to include(coverage_regex: 'Code coverage: \d+\.\d+')
end end
end end
end end
......
...@@ -10,10 +10,10 @@ describe Gitlab::Ci::Config::Entry::Global do ...@@ -10,10 +10,10 @@ describe Gitlab::Ci::Config::Entry::Global do
context 'when filtering all the entry/node names' do context 'when filtering all the entry/node names' do
it 'contains the expected node names' do it 'contains the expected node names' do
node_names = described_class.nodes.keys expect(described_class.nodes.keys)
expect(node_names).to match_array(%i[before_script image services .to match_array(%i[before_script image services
after_script variables stages after_script variables stages
types cache coverage]) types cache])
end end
end end
end end
...@@ -40,7 +40,7 @@ describe Gitlab::Ci::Config::Entry::Global do ...@@ -40,7 +40,7 @@ describe Gitlab::Ci::Config::Entry::Global do
end end
it 'creates node object for each entry' do it 'creates node object for each entry' do
expect(global.descendants.count).to eq 9 expect(global.descendants.count).to eq 8
end end
it 'creates node object using valid class' do it 'creates node object using valid class' do
...@@ -181,7 +181,7 @@ describe Gitlab::Ci::Config::Entry::Global do ...@@ -181,7 +181,7 @@ describe Gitlab::Ci::Config::Entry::Global do
describe '#nodes' do describe '#nodes' do
it 'instantizes all nodes' do it 'instantizes all nodes' do
expect(global.descendants.count).to eq 9 expect(global.descendants.count).to eq 8
end end
it 'contains unspecified nodes' do it 'contains unspecified nodes' 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