Commit ccff65be authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove unused method from CI/CD build class

parent 48d7ed63
...@@ -55,15 +55,6 @@ module Ci ...@@ -55,15 +55,6 @@ module Ci
pending.unstarted.order('created_at ASC').first pending.unstarted.order('created_at ASC').first
end end
def create_from(build)
new_build = build.dup
new_build.status = 'pending'
new_build.runner_id = nil
new_build.trigger_request_id = nil
new_build.token = nil
new_build.save
end
def retry(build, current_user) def retry(build, current_user)
Ci::RetryBuildService Ci::RetryBuildService
.new(build.project, current_user) .new(build.project, current_user)
......
...@@ -181,20 +181,6 @@ describe Ci::Build, :models do ...@@ -181,20 +181,6 @@ describe Ci::Build, :models do
end end
end end
describe '#create_from' do
before do
build.status = 'success'
build.save
end
let(:create_from_build) { Ci::Build.create_from build }
it 'exists a pending task' do
expect(Ci::Build.pending.count(:all)).to eq 0
create_from_build
expect(Ci::Build.pending.count(:all)).to be > 0
end
end
describe '#depends_on_builds' do describe '#depends_on_builds' do
let!(:build) { create(:ci_build, pipeline: pipeline, name: 'build', stage_idx: 0, stage: 'build') } let!(:build) { create(:ci_build, pipeline: pipeline, name: 'build', stage_idx: 0, stage: 'build') }
let!(:rspec_test) { create(:ci_build, pipeline: pipeline, name: 'rspec', stage_idx: 1, stage: 'test') } let!(:rspec_test) { create(:ci_build, pipeline: pipeline, name: 'rspec', stage_idx: 1, stage: 'test') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment