Commit 6f843457 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Improve build retry service tests for cloning data

parent dd9d8ce8
...@@ -80,6 +80,14 @@ FactoryGirl.define do ...@@ -80,6 +80,14 @@ FactoryGirl.define do
tag_list [:docker, :ruby] tag_list [:docker, :ruby]
end end
trait :on_tag do
tag true
end
trait :triggered do
trigger_request factory: :ci_trigger_request_with_variables
end
after(:build) do |build, evaluator| after(:build) do |build, evaluator|
build.project = build.pipeline.project build.project = build.pipeline.project
end end
......
...@@ -12,13 +12,16 @@ describe Ci::RetryBuildService, :services do ...@@ -12,13 +12,16 @@ describe Ci::RetryBuildService, :services do
shared_examples 'build duplication' do shared_examples 'build duplication' do
let(:build) do let(:build) do
create(:ci_build, :failed, :artifacts_expired, :erased, :trace, create(:ci_build, :failed, :artifacts_expired, :erased,
:queued, :coverage, :tags, pipeline: pipeline) :queued, :coverage, :tags, :allowed_to_fail, :on_tag,
:teardown_environment, :triggered, :trace,
description: 'some build', pipeline: pipeline)
end end
describe 'clone attributes' do describe 'clone attributes' do
described_class::CLONE_ACCESSORS.each do |attribute| described_class::CLONE_ACCESSORS.each do |attribute|
it "clones #{attribute} build attribute" do it "clones #{attribute} build attribute" do
expect(new_build.send(attribute)).to be_present
expect(new_build.send(attribute)).to eq build.send(attribute) expect(new_build.send(attribute)).to eq build.send(attribute)
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