Commit 1a71dd04 authored by Shinya Maeda's avatar Shinya Maeda

Fix rubocop

parent 8c867052
......@@ -13,14 +13,13 @@ module Ci
enum data_store: {
redis: 1,
db: 2,
db: 2
}
def data
case
when redis?
if redis?
redis_data
when db?
elsif db?
raw_data
else
raise 'Unsupported data store'
......@@ -30,10 +29,9 @@ module Ci
def set_data(value)
raise 'too much data' if value.bytesize > CHUNK_SIZE
case
when redis?
if redis?
redis_set_data(value)
when db?
elsif db?
self.raw_data = value
else
raise 'Unsupported data store'
......
......@@ -69,7 +69,7 @@ module Gitlab
def read(length = nil, outbuf = "")
out = ""
length = size - tell unless length
length ||= size - tell
until length <= 0 || eof?
data = chunk_slice_from_offset
......
......@@ -228,6 +228,8 @@ describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do
File.open(path)
end
end
it_behaves_like 'sets'
end
context 'when stream is ChunkedIO' do
......
......@@ -540,7 +540,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before do
stub_feature_flags(ci_enable_live_trace: false)
build; src_path; src_checksum; # Initialize after set feature flag
build # Initialize after set feature flag
src_path
src_checksum
end
it_behaves_like 'archive trace file'
......@@ -571,7 +573,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before do
stub_feature_flags(ci_enable_live_trace: false)
build; trace_content; src_checksum; # Initialize after set feature flag
build # Initialize after set feature flag
trace_content
src_checksum
build.update_column(:trace, trace_content)
end
......@@ -625,7 +629,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before do
stub_feature_flags(ci_enable_live_trace: true)
build; trace_raw; src_checksum; # Initialize after set feature flag
build # Initialize after set feature flag
trace_raw
src_checksum
end
it_behaves_like 'archive trace file in ChunkedIO'
......
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