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
Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Validate::Config,
Gitlab::Ci::Pipeline::Chain::Skip,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Size,
Gitlab::Ci::Pipeline::Chain::Create,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze
......
......@@ -43,11 +43,25 @@ describe Ci::CreatePipelineService, '#execute' do
# TODO, check failure reason
expect(pipeline).to be_persisted
expect(pipeline).to be_failed
expect(pipeline.statuses).not_to be_empty
expect(pipeline.statuses).to all(be_canceled)
end
end
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
......
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