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
Hide 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
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'
...
...
lib/gitlab/ci/trace/chunked_io.rb
View file @
1a71dd04
...
...
@@ -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
...
...
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
File
.
open
(
path
)
end
end
it_behaves_like
'sets'
end
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
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'
...
...
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