summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-09-04 22:34:10 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2018-09-04 22:34:10 +0200
commitd206b20c27746986e332fb9ff1305b24f0be1d7d (patch)
tree745e4a9a649b6ef5eb36d8d2c90b42a31ff4a2eb
parentba97e22537afe7f896a6233b8f68d59e99236c02 (diff)
downloadgitlab-ce-kamil-refactor-ci-builds-v3.tar.gz
Revert "Start to remove config processor from Ci::Pipeline"kamil-refactor-ci-builds-v3
This reverts commit d6c3446df5d238480d479861f2f3985f8e593306.
-rw-r--r--app/models/ci/pipeline.rb4
-rw-r--r--spec/models/ci/pipeline_spec.rb17
2 files changed, 21 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 00aa8d136ba..526bf7af99b 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -419,6 +419,10 @@ module Ci
end
end
+ def seeds_size
+ stage_seeds.sum(&:size)
+ end
+
def has_kubernetes_active?
project.deployment_platform&.active?
end
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 2d5a1bcf046..77b7332a761 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -399,6 +399,23 @@ describe Ci::Pipeline, :mailer do
end
end
+ describe '#seeds_size' do
+ context 'when refs policy is specified' do
+ let(:config) do
+ { production: { stage: 'deploy', script: 'cap prod', only: ['master'] },
+ spinach: { stage: 'test', script: 'spinach', only: ['tags'] } }
+ end
+
+ let(:pipeline) do
+ build(:ci_pipeline, ref: 'feature', tag: true, config: config)
+ end
+
+ it 'returns real seeds size' do
+ expect(pipeline.seeds_size).to eq 1
+ end
+ end
+ end
+
describe 'legacy stages' do
before do
create(:commit_status, pipeline: pipeline,