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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
7297a06c
Commit
7297a06c
authored
Apr 06, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bunch of texts
parent
3b97710c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
53 deletions
+9
-53
.flayignore
.flayignore
+1
-0
app/controllers/projects/jobs_controller.rb
app/controllers/projects/jobs_controller.rb
+1
-1
lib/gitlab/ci/trace/chunked_io.rb
lib/gitlab/ci/trace/chunked_io.rb
+0
-2
lib/gitlab/ci/trace/stream.rb
lib/gitlab/ci/trace/stream.rb
+5
-1
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+0
-40
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
+0
-8
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+2
-1
No files found.
.flayignore
View file @
7297a06c
...
...
@@ -9,3 +9,4 @@ lib/gitlab/gitaly_client/operation_service.rb
lib/gitlab/background_migration/*
app/models/project_services/kubernetes_service.rb
lib/gitlab/workhorse.rb
lib/gitlab/ci/trace/chunked_io.rb
app/controllers/projects/jobs_controller.rb
View file @
7297a06c
...
...
@@ -128,7 +128,7 @@ class Projects::JobsController < Projects::ApplicationController
if
stream
.
file?
send_file
stream
.
path
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
else
render_404
send_data
stream
.
raw
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
end
end
end
...
...
lib/gitlab/ci/trace/chunked_io.rb
View file @
7297a06c
...
...
@@ -113,8 +113,6 @@ module Gitlab
end
def
write
(
data
)
raise
'Could not write empty data'
unless
data
.
present?
start_pos
=
tell
data
=
data
.
force_encoding
(
Encoding
::
BINARY
)
...
...
lib/gitlab/ci/trace/stream.rb
View file @
7297a06c
...
...
@@ -8,7 +8,7 @@ module Gitlab
attr_reader
:stream
delegate
:close
,
:tell
,
:seek
,
:size
,
:
path
,
:
url
,
:truncate
,
to: :stream
,
allow_nil:
true
delegate
:close
,
:tell
,
:seek
,
:size
,
:url
,
:truncate
,
to: :stream
,
allow_nil:
true
delegate
:valid?
,
to: :stream
,
as: :present?
,
allow_nil:
true
...
...
@@ -25,6 +25,10 @@ module Gitlab
self
.
path
.
present?
end
def
file?
self
.
path
if
self
.
stream
.
respond_to?
(
:path
)
end
def
limit
(
last_bytes
=
LIMIT_SIZE
)
if
last_bytes
<
size
stream
.
seek
(
-
last_bytes
,
IO
::
SEEK_END
)
...
...
spec/features/projects/jobs_spec.rb
View file @
7297a06c
...
...
@@ -15,8 +15,6 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
end
before
do
stub_feature_flags
(
ci_enable_live_trace:
true
)
project
.
add_role
(
user
,
user_access_level
)
sign_in
(
user
)
end
...
...
@@ -537,44 +535,6 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
end
end
context
'storage form'
do
let
(
:existing_file
)
{
Tempfile
.
new
(
'existing-trace-file'
).
path
}
before
do
job
.
run!
end
context
'when job has trace in file'
,
:js
do
before
do
allow_any_instance_of
(
Gitlab
::
Ci
::
Trace
)
.
to
receive
(
:paths
)
.
and_return
([
existing_file
])
end
it
'sends the right headers'
do
requests
=
inspect_requests
(
inject_headers:
{
'X-Sendfile-Type'
=>
'X-Sendfile'
})
do
visit
raw_project_job_path
(
project
,
job
)
end
expect
(
requests
.
first
.
response_headers
[
'Content-Type'
]).
to
eq
(
'text/plain; charset=utf-8'
)
expect
(
requests
.
first
.
response_headers
[
'X-Sendfile'
]).
to
eq
(
existing_file
)
end
end
context
'when job has trace in the database'
,
:js
do
before
do
allow_any_instance_of
(
Gitlab
::
Ci
::
Trace
)
.
to
receive
(
:paths
)
.
and_return
([])
visit
project_job_path
(
project
,
job
)
end
it
'sends the right headers'
do
expect
(
page
).
not_to
have_selector
(
'.js-raw-link-controller'
)
end
end
end
context
"when visiting old URL"
do
let
(
:raw_job_url
)
do
raw_project_job_path
(
project
,
job
)
...
...
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
View file @
7297a06c
...
...
@@ -298,14 +298,6 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
it_behaves_like
'writes a trace'
end
context
'when data is nil'
do
let
(
:data
)
{
nil
}
it
'writes a trace'
do
expect
{
subject
}
.
to
raise_error
(
'Could not write empty data'
)
end
end
end
context
'when data already exists'
do
...
...
spec/requests/api/runner_spec.rb
View file @
7297a06c
require
'spec_helper'
describe
API
::
Runner
do
describe
API
::
Runner
,
:clean_gitlab_redis_shared_state
do
include
StubGitlabCalls
let
(
:registration_token
)
{
'abcdefg123456'
}
before
do
stub_feature_flags
(
ci_enable_live_trace:
true
)
stub_gitlab_calls
stub_application_setting
(
runners_registration_token:
registration_token
)
allow_any_instance_of
(
Ci
::
Runner
).
to
receive
(
:cache_attributes
)
...
...
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