Commit 54263dc1 authored by Shinya Maeda's avatar Shinya Maeda Committed by Alessio Caiazza

Fix coding style offence

parent b5a591d8
...@@ -11,6 +11,7 @@ module Ci ...@@ -11,6 +11,7 @@ module Ci
else else
build.enqueue build.enqueue
end end
true true
else else
build.skip build.skip
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
runner_system_failure: 'runner system failure', runner_system_failure: 'runner system failure',
missing_dependency_failure: 'missing dependency failure', missing_dependency_failure: 'missing dependency failure',
runner_unsupported: 'unsupported runner', runner_unsupported: 'unsupported runner',
schedule_expired: 'schedule expired', schedule_expired: 'schedule expired'
}.freeze }.freeze
private_constant :REASONS private_constant :REASONS
......
...@@ -257,7 +257,7 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -257,7 +257,7 @@ describe Ci::ProcessPipelineService, '#execute' do
it 'properly processes the pipeline' do it 'properly processes the pipeline' do
expect(process_pipeline).to be_truthy expect(process_pipeline).to be_truthy
expect(builds_names_and_statuses).to eq({ 'build': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'pending' })
succeed_pending succeed_pending
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' })
...@@ -283,7 +283,7 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -283,7 +283,7 @@ describe Ci::ProcessPipelineService, '#execute' do
it 'properly processes the pipeline' do it 'properly processes the pipeline' do
expect(process_pipeline).to be_truthy expect(process_pipeline).to be_truthy
expect(builds_names_and_statuses).to eq({ 'build': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'pending' })
fail_running_or_pending fail_running_or_pending
expect(builds_names_and_statuses).to eq({ 'build': 'failed' }) expect(builds_names_and_statuses).to eq({ 'build': 'failed' })
...@@ -295,11 +295,11 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -295,11 +295,11 @@ describe Ci::ProcessPipelineService, '#execute' do
it 'properly processes the pipeline' do it 'properly processes the pipeline' do
expect(process_pipeline).to be_truthy expect(process_pipeline).to be_truthy
expect(builds_names_and_statuses).to eq({ 'build': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'pending' })
succeed_pending succeed_pending
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' })
unschedule unschedule
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'manual' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'manual' })
...@@ -324,11 +324,11 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -324,11 +324,11 @@ describe Ci::ProcessPipelineService, '#execute' do
it 'properly processes the pipeline' do it 'properly processes the pipeline' do
expect(process_pipeline).to be_truthy expect(process_pipeline).to be_truthy
expect(builds_names_and_statuses).to eq({ 'build': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'pending' })
succeed_pending succeed_pending
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' })
enqueue_scheduled('rollout10%') enqueue_scheduled('rollout10%')
fail_running_or_pending fail_running_or_pending
...@@ -354,11 +354,11 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -354,11 +354,11 @@ describe Ci::ProcessPipelineService, '#execute' do
it 'properly processes the pipeline' do it 'properly processes the pipeline' do
expect(process_pipeline).to be_truthy expect(process_pipeline).to be_truthy
expect(builds_names_and_statuses).to eq({ 'build': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'pending' })
succeed_pending succeed_pending
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'scheduled' })
play_manual_action('rollout10%') play_manual_action('rollout10%')
expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'pending' }) expect(builds_names_and_statuses).to eq({ 'build': 'success', 'rollout10%': 'pending' })
...@@ -718,7 +718,10 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -718,7 +718,10 @@ describe Ci::ProcessPipelineService, '#execute' do
end end
def builds_names_and_statuses def builds_names_and_statuses
builds.inject({}) { |h, b| h[b.name.to_sym] = b.status; h } builds.each_with_object({}) do |h, b|
h[b.name.to_sym] = b.status
h
end
end end
def all_builds_names def all_builds_names
......
...@@ -10,7 +10,7 @@ describe Ci::BuildScheduleWorker do ...@@ -10,7 +10,7 @@ describe Ci::BuildScheduleWorker do
it 'executes RunScheduledBuildService' do it 'executes RunScheduledBuildService' do
expect_any_instance_of(Ci::RunScheduledBuildService) expect_any_instance_of(Ci::RunScheduledBuildService)
.to receive(:execute).once .to receive(:execute).once
subject subject
end end
end end
......
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