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

Build attributes with hash, fix gitlab yaml processor tests

上级 cd556253
......@@ -13,16 +13,25 @@ module Ci
private
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,
project: pipeline.project,
ref: pipeline.ref,
tag: pipeline.tag,
user: current_user,
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)
end
......
......@@ -26,7 +26,9 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
......@@ -443,7 +445,9 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
......@@ -471,7 +475,9 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
end
......@@ -716,7 +722,9 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
......@@ -859,7 +867,9 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
end
......@@ -904,7 +914,9 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
expect(subject.second).to eq({
stage: "build",
......@@ -916,7 +928,9 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
yaml_variables: []
yaml_variables: [],
only: nil,
except: nil
})
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册