Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1a71dd04
Commit
1a71dd04
authored
Apr 06, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop
parent
8c867052
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
app/models/ci/job_trace_chunk.rb
app/models/ci/job_trace_chunk.rb
+5
-7
lib/gitlab/ci/trace/chunked_io.rb
lib/gitlab/ci/trace/chunked_io.rb
+1
-1
spec/lib/gitlab/ci/trace/stream_spec.rb
spec/lib/gitlab/ci/trace/stream_spec.rb
+2
-0
spec/lib/gitlab/ci/trace_spec.rb
spec/lib/gitlab/ci/trace_spec.rb
+9
-3
No files found.
app/models/ci/job_trace_chunk.rb
View file @
1a71dd04
...
@@ -13,14 +13,13 @@ module Ci
...
@@ -13,14 +13,13 @@ module Ci
enum
data_store:
{
enum
data_store:
{
redis:
1
,
redis:
1
,
db:
2
,
db:
2
}
}
def
data
def
data
case
if
redis?
when
redis?
redis_data
redis_data
when
db?
elsif
db?
raw_data
raw_data
else
else
raise
'Unsupported data store'
raise
'Unsupported data store'
...
@@ -30,10 +29,9 @@ module Ci
...
@@ -30,10 +29,9 @@ module Ci
def
set_data
(
value
)
def
set_data
(
value
)
raise
'too much data'
if
value
.
bytesize
>
CHUNK_SIZE
raise
'too much data'
if
value
.
bytesize
>
CHUNK_SIZE
case
if
redis?
when
redis?
redis_set_data
(
value
)
redis_set_data
(
value
)
when
db?
elsif
db?
self
.
raw_data
=
value
self
.
raw_data
=
value
else
else
raise
'Unsupported data store'
raise
'Unsupported data store'
...
...
lib/gitlab/ci/trace/chunked_io.rb
View file @
1a71dd04
...
@@ -69,7 +69,7 @@ module Gitlab
...
@@ -69,7 +69,7 @@ module Gitlab
def
read
(
length
=
nil
,
outbuf
=
""
)
def
read
(
length
=
nil
,
outbuf
=
""
)
out
=
""
out
=
""
length
=
size
-
tell
unless
length
length
||=
size
-
tell
until
length
<=
0
||
eof?
until
length
<=
0
||
eof?
data
=
chunk_slice_from_offset
data
=
chunk_slice_from_offset
...
...
spec/lib/gitlab/ci/trace/stream_spec.rb
View file @
1a71dd04
...
@@ -228,6 +228,8 @@ describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do
...
@@ -228,6 +228,8 @@ describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do
File
.
open
(
path
)
File
.
open
(
path
)
end
end
end
end
it_behaves_like
'sets'
end
end
context
'when stream is ChunkedIO'
do
context
'when stream is ChunkedIO'
do
...
...
spec/lib/gitlab/ci/trace_spec.rb
View file @
1a71dd04
...
@@ -540,7 +540,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
...
@@ -540,7 +540,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before
do
before
do
stub_feature_flags
(
ci_enable_live_trace:
false
)
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
end
it_behaves_like
'archive trace file'
it_behaves_like
'archive trace file'
...
@@ -571,7 +573,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
...
@@ -571,7 +573,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before
do
before
do
stub_feature_flags
(
ci_enable_live_trace:
false
)
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
)
build
.
update_column
(
:trace
,
trace_content
)
end
end
...
@@ -625,7 +629,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
...
@@ -625,7 +629,9 @@ describe Gitlab::Ci::Trace, :clean_gitlab_redis_cache do
before
do
before
do
stub_feature_flags
(
ci_enable_live_trace:
true
)
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
end
it_behaves_like
'archive trace file in ChunkedIO'
it_behaves_like
'archive trace file in ChunkedIO'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment