Just create failed builds rather than calling events

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7617#note_18763033
This commit is contained in:
Lin Jen-Shin 2016-11-22 13:41:39 +08:00
parent da9726170c
commit d20c0682ac
1 changed files with 3 additions and 6 deletions

View File

@ -571,13 +571,10 @@ describe Ci::Pipeline, models: true do
context 'with failed pipeline' do
before do
perform_enqueued_jobs do
create(:ci_build, :created, pipeline: pipeline)
create(:generic_commit_status, :created, pipeline: pipeline)
create(:ci_build, :failed, pipeline: pipeline)
create(:generic_commit_status, :failed, pipeline: pipeline)
pipeline.statuses.count.times do |offset|
# workaround race conditions
pipeline.statuses.offset(offset).first.drop
end
pipeline.drop
end
end