BigW Consortium Gitlab

Commit d16bb447 by Grzegorz Bizon

Start building abstraction over pipeline seeds

parent b24b45be
module Gitlab
module Ci
module Pipeline
module Seed
class Base
def attributes
raise NotImplementedError
end
def excluded?
raise NotImplementedError
end
end
end
end
end
end
module Gitlab
module Ci
module Stage
class Seed
module Pipeline
module Seed
class Stage < Seed::Base
include ::Gitlab::Utils::StrongMemoize
attr_reader :pipeline
......@@ -63,4 +64,5 @@ module Gitlab
end
end
end
end
end
......@@ -73,7 +73,8 @@ module Gitlab
seeds = @stages.uniq.map do |stage|
builds = pipeline_stage_builds(stage, pipeline)
Gitlab::Ci::Stage::Seed.new(pipeline, stage, builds) if builds.any?
Gitlab::Ci::Pipeline::Seed::Stage
.new(pipeline, stage, builds) if builds.any?
end
seeds.compact
......
require 'spec_helper'
describe Gitlab::Ci::Stage::Seed do
describe Gitlab::Ci::Pipeline::Seed::Stage do
let(:pipeline) { create(:ci_empty_pipeline) }
let(:builds) do
......
......@@ -247,7 +247,8 @@ describe Ci::Pipeline, :mailer do
end
it 'returns preseeded stage seeds object' do
expect(pipeline.stage_seeds).to all(be_a Gitlab::Ci::Stage::Seed)
expect(pipeline.stage_seeds)
.to all(be_a Gitlab::Ci::Pipeline::Seed::Base)
expect(pipeline.stage_seeds.count).to eq 1
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