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
08a57fe8
Commit
08a57fe8
authored
Oct 31, 2018
by
Ahmad Hassan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more specs
parent
e2cb9245
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
401 additions
and
6 deletions
+401
-6
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+0
-1
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+1
-5
spec/lib/gitlab/gitaly_client_spec.rb
spec/lib/gitlab/gitaly_client_spec.rb
+18
-0
spec/models/blob_spec.rb
spec/models/blob_spec.rb
+382
-0
No files found.
config/initializers/1_settings.rb
View file @
08a57fe8
...
...
@@ -429,7 +429,6 @@ Settings.rack_attack.git_basic_auth['bantime'] ||= 1.hour
# Gitaly
#
Settings
[
'gitaly'
]
||=
Settingslogic
.
new
({})
Settings
.
gitaly
[
'tls'
]
||=
Settingslogic
.
new
({})
#
# Webpack settings
...
...
lib/gitlab/gitaly_client.rb
View file @
08a57fe8
...
...
@@ -53,10 +53,6 @@ module Gitlab
base_labels
Gitlab
::
Metrics
::
Transaction
::
BASE_LABELS
.
merge
(
gitaly_service:
nil
,
rpc:
nil
)
end
def
self
.
creds
Gitlab
.
config
.
gitaly
.
tls
.
credentials
end
def
self
.
stub
(
name
,
storage
)
MUTEX
.
synchronize
do
@stubs
||=
{}
...
...
@@ -72,7 +68,7 @@ module Gitlab
def
self
.
stub_creds
(
storage
)
if
URI
(
address
(
storage
)).
scheme
==
'tls'
GRPC
::
Co
d
e
::
ChannelCredentials
.
new
GRPC
::
Co
r
e
::
ChannelCredentials
.
new
else
:this_channel_is_insecure
end
...
...
spec/lib/gitlab/gitaly_client_spec.rb
View file @
08a57fe8
...
...
@@ -28,6 +28,24 @@ describe Gitlab::GitalyClient, skip_gitaly_mock: true do
end
end
describe
'.stub_creds'
do
it
'returns :this_channel_is_insecure if tcp'
do
address
=
'tcp://localhost:9876'
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
({
'default'
=>
{
'gitaly_address'
=>
address
}
})
expect
(
described_class
.
stub_creds
(
'default'
)).
to
eq
(
:this_channel_is_insecure
)
end
it
'returns Credentials object if tls'
do
address
=
'tls://localhost:9876'
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
({
'default'
=>
{
'gitaly_address'
=>
address
}
})
expect
(
described_class
.
stub_creds
(
'default'
)).
to
be_a
(
GRPC
::
Core
::
ChannelCredentials
)
end
end
describe
'.stub'
do
# Notice that this is referring to gRPC "stubs", not rspec stubs
before
do
...
...
spec/models/blob_spec.rb
0 → 100644
View file @
08a57fe8
This diff is collapsed.
Click to expand it.
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