Merge branch 'fix-test-for-build-attributes' into 'master'

Fix build attributes test

See merge request !9409
This commit is contained in:
Kamil Trzciński 2017-02-23 14:36:53 +00:00
commit cfd7602dde
2 changed files with 6 additions and 5 deletions

View File

@ -1,16 +1,17 @@
module Ci
class RetryBuildService < ::BaseService
CLONE_ATTRIBUTES = %i[pipeline ref tag options commands tag_list name
CLONE_ATTRIBUTES = %i[pipeline project ref tag options commands name
allow_failure stage stage_idx trigger_request
yaml_variables when environment coverage_regex]
.freeze
REJECT_ATTRIBUTES = %i[id status user token coverage trace runner
artifacts_file artifacts_metadata artifacts_size
artifacts_expire_at artifacts_file
artifacts_metadata artifacts_size
created_at updated_at started_at finished_at
queued_at erased_by erased_at].freeze
IGNORE_ATTRIBUTES = %i[trace type lock_version project target_url
IGNORE_ATTRIBUTES = %i[type lock_version gl_project_id target_url
deploy job_id description].freeze
def execute(build)

View File

@ -12,7 +12,7 @@ describe Ci::RetryBuildService, :services do
shared_examples 'build duplication' do
let(:build) do
create(:ci_build, :failed, :artifacts, :erased, :trace,
create(:ci_build, :failed, :artifacts_expired, :erased, :trace,
:queued, :coverage, pipeline: pipeline)
end
@ -38,7 +38,7 @@ describe Ci::RetryBuildService, :services do
described_class::IGNORE_ATTRIBUTES +
described_class::REJECT_ATTRIBUTES
expect(attributes.size).to eq build.attributes.size
expect(build.attributes.size).to eq(attributes.size)
end
end