summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-02-21 17:08:35 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-02-21 17:08:35 +0800
commit1f244284284607946b2758c4e9ef26559cd8d71c (patch)
tree9c7be2bec9cbb8a2e09acad07c68068f0748caaf
parentb596dd8fedd9dc8f9487e1e67a52a7b211bd956b (diff)
downloadgitlab-ce-1f244284284607946b2758c4e9ef26559cd8d71c.tar.gz
Fix build attributes test, see:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9021#note_23782188 This is discovered by https://gitlab.com/gitlab-org/gitlab-ce/builds/10815456 I removed `gl_project_id` and this is failing. I took some look, realizing that: * `trace` is duplicated in `attributes` * `tag_list` is not included in `build.attributes` * `artifacts_expire_at` is missing in `attributes` So we need to: * Remove duplicated `trace` in `attributes` (40 -> 39) * Remove `tag_list` in `attributes` (39 -> 38) * Add `artifacts_expire_at` to `attributes` (38 -> 39) * Add `gl_project_id` to `attributes` (39 -> 40)
-rw-r--r--app/services/ci/retry_build_service.rb7
-rw-r--r--spec/services/ci/retry_build_service_spec.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb
index 4b47ee489cf..4ce9cabeda3 100644
--- a/app/services/ci/retry_build_service.rb
+++ b/app/services/ci/retry_build_service.rb
@@ -1,16 +1,17 @@
module Ci
class RetryBuildService < ::BaseService
- CLONE_ATTRIBUTES = %i[pipeline ref tag options commands tag_list name
+ CLONE_ATTRIBUTES = %i[pipeline 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 project gl_project_id target_url
deploy job_id description].freeze
def execute(build)
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb
index 93147870afe..d03f7505eac 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -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