summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-01 11:57:06 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-01 11:57:06 +0100
commit6f84345725ef11493653a888ed59fc6411825779 (patch)
tree9c165da9ba13fd80829992239003335abf702234
parentdd9d8ce82e5957974f87401d6dd437e4d2f3ad38 (diff)
downloadgitlab-ce-6f84345725ef11493653a888ed59fc6411825779.tar.gz
Improve build retry service tests for cloning data
-rw-r--r--spec/factories/ci/builds.rb8
-rw-r--r--spec/services/ci/retry_build_service_spec.rb7
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 8218293604d..cabe128acf7 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -80,6 +80,14 @@ FactoryGirl.define do
tag_list [:docker, :ruby]
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|
build.project = build.pipeline.project
end
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb
index f4bc05377dc..bcd89544647 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -12,13 +12,16 @@ describe Ci::RetryBuildService, :services do
shared_examples 'build duplication' do
let(:build) do
- create(:ci_build, :failed, :artifacts_expired, :erased, :trace,
- :queued, :coverage, :tags, pipeline: pipeline)
+ create(:ci_build, :failed, :artifacts_expired, :erased,
+ :queued, :coverage, :tags, :allowed_to_fail, :on_tag,
+ :teardown_environment, :triggered, :trace,
+ description: 'some build', pipeline: pipeline)
end
describe 'clone attributes' do
described_class::CLONE_ACCESSORS.each do |attribute|
it "clones #{attribute} build attribute" do
+ expect(new_build.send(attribute)).to be_present
expect(new_build.send(attribute)).to eq build.send(attribute)
end
end