Commit 99411fe5 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Check pipeline size limit when creating a pipeline

parent fd724ace
...@@ -6,6 +6,7 @@ module Ci ...@@ -6,6 +6,7 @@ module Ci
Gitlab::Ci::Pipeline::Chain::Validate::Repository, Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Validate::Config, Gitlab::Ci::Pipeline::Chain::Validate::Config,
Gitlab::Ci::Pipeline::Chain::Skip, Gitlab::Ci::Pipeline::Chain::Skip,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Size,
Gitlab::Ci::Pipeline::Chain::Create, Gitlab::Ci::Pipeline::Chain::Create,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze EE::Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze
......
...@@ -43,11 +43,25 @@ describe Ci::CreatePipelineService, '#execute' do ...@@ -43,11 +43,25 @@ describe Ci::CreatePipelineService, '#execute' do
# TODO, check failure reason # TODO, check failure reason
expect(pipeline).to be_persisted expect(pipeline).to be_persisted
expect(pipeline).to be_failed expect(pipeline).to be_failed
expect(pipeline.statuses).not_to be_empty
expect(pipeline.statuses).to all(be_canceled) expect(pipeline.statuses).to all(be_canceled)
end end
end end
context 'when pipeline size limit is exceeded' do context 'when pipeline size limit is exceeded' do
before do
namespace.plan.update_column(:pipeline_size_limit, 2)
end
it 'drops pipeline without creating jobs' do
pipeline = create_pipeline!
# TODO, check failure reason
expect(pipeline).to be_persisted
expect(pipeline).to be_failed
expect(pipeline.seeds_size).to be > 2
expect(pipeline.statuses).to be_empty
end
end end
end end
......
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