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
26ba46d2
Commit
26ba46d2
authored
Aug 21, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for Geo download instrumentation
parent
963d48fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
spec/services/geo/file_download_service_spec.rb
spec/services/geo/file_download_service_spec.rb
+9
-1
No files found.
spec/services/geo/file_download_service_spec.rb
View file @
26ba46d2
...
...
@@ -98,14 +98,22 @@ describe Geo::FileDownloadService do
subject
{
described_class
.
new
(
:lfs
,
lfs_object
.
id
)
}
it
'downloads an LFS object'
do
before
do
allow_any_instance_of
(
Gitlab
::
ExclusiveLease
)
.
to
receive
(
:try_obtain
).
and_return
(
true
)
allow_any_instance_of
(
Gitlab
::
Geo
::
LfsTransfer
)
.
to
receive
(
:download_from_primary
).
and_return
(
100
)
end
it
'downloads an LFS object'
do
expect
{
subject
.
execute
}.
to
change
{
Geo
::
FileRegistry
.
count
}.
by
(
1
)
end
it
'logs a message'
do
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
with
(
hash_including
(
:message
,
:download_time_s
,
success:
true
,
bytes_downloaded:
100
)).
and_call_original
subject
.
execute
end
end
context
'bad object type'
do
...
...
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