Commit 15fd6908 authored by Peter Leitzen's avatar Peter Leitzen

Fix compile time warnings for unused variables

It fixes:
  warning: assigned but unused variable - VAR
parent 989a09fc
...@@ -57,7 +57,7 @@ module StatusPage ...@@ -57,7 +57,7 @@ module StatusPage
# Return a Set of all keys with a given prefix # Return a Set of all keys with a given prefix
def list_object_keys(prefix) def list_object_keys(prefix)
wrap_errors(prefix: prefix) do wrap_errors(prefix: prefix) do
list_objects(prefix).reduce(Set.new) do |objects, (response, index)| list_objects(prefix).reduce(Set.new) do |objects, (response, _index)|
break objects if objects.size >= StatusPage::Storage::MAX_UPLOADS break objects if objects.size >= StatusPage::Storage::MAX_UPLOADS
objects | response.contents.map(&:key) objects | response.contents.map(&:key)
......
...@@ -43,9 +43,7 @@ module Gitlab ...@@ -43,9 +43,7 @@ module Gitlab
end end
def suite_errors def suite_errors
test_suites.each_with_object({}) do |(name, suite), errors| test_suites.transform_values(&:suite_error).compact
errors[suite.name] = suite.suite_error if suite.suite_error
end
end end
TestCase::STATUS_TYPES.each do |status_type| TestCase::STATUS_TYPES.each do |status_type|
......
...@@ -60,16 +60,14 @@ RSpec.describe Gitlab::JobWaiter do ...@@ -60,16 +60,14 @@ RSpec.describe Gitlab::JobWaiter do
described_class.notify(waiter.key, 'a') described_class.notify(waiter.key, 'a')
described_class.notify(waiter.key, 'b') described_class.notify(waiter.key, 'b')
result = nil expect { Timeout.timeout(1) { waiter.wait(2) } }.not_to raise_error
expect { Timeout.timeout(1) { result = waiter.wait(2) } }.not_to raise_error
end end
it 'increments job_waiter_started_total and job_waiter_timeouts_total when it times out' do it 'increments job_waiter_started_total and job_waiter_timeouts_total when it times out' do
expect(started_total).to receive(:increment).with(worker: 'Foo') expect(started_total).to receive(:increment).with(worker: 'Foo')
expect(timeouts_total).to receive(:increment).with(worker: 'Foo') expect(timeouts_total).to receive(:increment).with(worker: 'Foo')
result = nil expect { Timeout.timeout(2) { waiter.wait(1) } }.not_to raise_error
expect { Timeout.timeout(2) { result = waiter.wait(1) } }.not_to raise_error
end end
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