提交 52ebeb5a 编写于 作者: K Katarzyna Kobierska

Build attributes with hash, fix gitlab yaml processor tests

上级 cd556253
...@@ -13,16 +13,25 @@ module Ci ...@@ -13,16 +13,25 @@ module Ci
private private
def create_build(build_attributes) def create_build(build_attributes)
build_attributes = build_attributes.merge( build_attributes = {
stage_idx: build_attributes[:stage_idx],
stage: build_attributes[:stage],
commands: build_attributes[:commands],
tag_list: build_attributes[:tag_list],
name: build_attributes[:name],
when: build_attributes[:when],
allow_failure: build_attributes[:allow_failure],
environment: build_attributes[:environment],
yaml_variables: build_attributes[:yaml_variables],
options: build_attributes[:options],
pipeline: pipeline, pipeline: pipeline,
project: pipeline.project, project: pipeline.project,
ref: pipeline.ref, ref: pipeline.ref,
tag: pipeline.tag, tag: pipeline.tag,
user: current_user, user: current_user,
trigger_request: trigger_request trigger_request: trigger_request
) }
# OPTIMIZE: We copy over all attributes of Job into Build, therefore this workaround
build_attributes = build_attributes.except(:only, :except)
pipeline.builds.create(build_attributes) pipeline.builds.create(build_attributes)
end end
......
...@@ -26,7 +26,9 @@ module Ci ...@@ -26,7 +26,9 @@ module Ci
allow_failure: false, allow_failure: false,
when: "on_success", when: "on_success",
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
...@@ -443,7 +445,9 @@ module Ci ...@@ -443,7 +445,9 @@ module Ci
allow_failure: false, allow_failure: false,
when: "on_success", when: "on_success",
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
...@@ -471,7 +475,9 @@ module Ci ...@@ -471,7 +475,9 @@ module Ci
allow_failure: false, allow_failure: false,
when: "on_success", when: "on_success",
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
end end
...@@ -716,7 +722,9 @@ module Ci ...@@ -716,7 +722,9 @@ module Ci
when: "on_success", when: "on_success",
allow_failure: false, allow_failure: false,
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
...@@ -859,7 +867,9 @@ module Ci ...@@ -859,7 +867,9 @@ module Ci
when: "on_success", when: "on_success",
allow_failure: false, allow_failure: false,
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
end end
...@@ -904,7 +914,9 @@ module Ci ...@@ -904,7 +914,9 @@ module Ci
when: "on_success", when: "on_success",
allow_failure: false, allow_failure: false,
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
expect(subject.second).to eq({ expect(subject.second).to eq({
stage: "build", stage: "build",
...@@ -916,7 +928,9 @@ module Ci ...@@ -916,7 +928,9 @@ module Ci
when: "on_success", when: "on_success",
allow_failure: false, allow_failure: false,
environment: nil, environment: nil,
yaml_variables: [] yaml_variables: [],
only: nil,
except: nil
}) })
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册