Fix PipelineTriggerService to associate trigger_request with builds
This commit is contained in:
parent
373ff978df
commit
7338800787
|
@ -14,7 +14,7 @@ module Ci
|
||||||
|
|
||||||
pipeline = Ci::CreatePipelineService.new(project, trigger.owner, ref: params[:ref])
|
pipeline = Ci::CreatePipelineService.new(project, trigger.owner, ref: params[:ref])
|
||||||
.execute(:trigger, ignore_skip_ci: true) do |pipeline|
|
.execute(:trigger, ignore_skip_ci: true) do |pipeline|
|
||||||
trigger.trigger_requests.create!(pipeline: pipeline)
|
pipeline.trigger_requests.create!(trigger: trigger)
|
||||||
create_pipeline_variables!(pipeline)
|
create_pipeline_variables!(pipeline)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ describe Ci::PipelineTriggerService do
|
||||||
expect(result[:pipeline].ref).to eq('master')
|
expect(result[:pipeline].ref).to eq('master')
|
||||||
expect(result[:pipeline].project).to eq(project)
|
expect(result[:pipeline].project).to eq(project)
|
||||||
expect(result[:pipeline].user).to eq(trigger.owner)
|
expect(result[:pipeline].user).to eq(trigger.owner)
|
||||||
|
expect([result[:pipeline].trigger_requests.last])
|
||||||
|
.to eq(result[:pipeline].builds.map(&:trigger_request).uniq)
|
||||||
expect(result[:status]).to eq(:success)
|
expect(result[:status]).to eq(:success)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue