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
7bb1227f
Commit
7bb1227f
authored
Mar 21, 2018
by
Brett Walker
Committed by
Nick Thomas
Mar 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spelling of fdw table name that caused 500 error
parent
87f19344
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
59 deletions
+117
-59
ee/app/finders/geo/job_artifact_registry_finder.rb
ee/app/finders/geo/job_artifact_registry_finder.rb
+1
-1
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
+116
-58
No files found.
ee/app/finders/geo/job_artifact_registry_finder.rb
View file @
7bb1227f
...
...
@@ -76,7 +76,7 @@ module Geo
#
def
fdw_find_job_artifacts
fdw_job_artifacts
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_job
s
_artifacts_table
}
.id"
)
fdw_job_artifacts
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_job_artifacts_table
}
.id"
)
.
with_files_stored_locally
.
merge
(
Geo
::
FileRegistry
.
job_artifacts
)
end
...
...
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
View file @
7bb1227f
...
...
@@ -21,12 +21,71 @@ describe Geo::JobArtifactRegistryFinder, :geo do
describe
'#count_synced_job_artifacts'
do
it
'delegates to #legacy_find_synced_job_artifacts'
do
allow
(
subject
).
to
receive
(
:aggregate_pushdown_supported?
).
and_return
(
false
)
expect
(
subject
).
to
receive
(
:legacy_find_synced_job_artifacts
).
and_call_original
subject
.
count_synced_job_artifacts
end
it
'counts job artifacts that has been synced'
do
it
'delegates to #find_synced_job_artifacts for PostgreSQL 10'
do
allow
(
subject
).
to
receive
(
:aggregate_pushdown_supported?
).
and_return
(
true
)
expect
(
subject
).
to
receive
(
:find_synced_job_artifacts
).
and_call_original
subject
.
count_synced_job_artifacts
end
end
describe
'#count_failed_job_artifacts'
do
it
'delegates to #legacy_find_failed_job_artifacts'
do
allow
(
subject
).
to
receive
(
:aggregate_pushdown_supported?
).
and_return
(
false
)
expect
(
subject
).
to
receive
(
:legacy_find_failed_job_artifacts
).
and_call_original
subject
.
count_failed_job_artifacts
end
it
'delegates to #find_failed_job_artifacts'
do
allow
(
subject
).
to
receive
(
:aggregate_pushdown_supported?
).
and_return
(
true
)
expect
(
subject
).
to
receive
(
:find_failed_job_artifacts
).
and_call_original
subject
.
count_failed_job_artifacts
end
end
shared_examples
'counts all the things'
do
describe
'#count_job_artifacts'
do
it
'counts job artifacts'
do
expect
(
subject
.
count_job_artifacts
).
to
eq
4
end
it
'ignores remote job artifacts'
do
job_artifact_1
.
update!
(
file_store:
ObjectStorage
::
Store
::
REMOTE
)
expect
(
subject
.
count_job_artifacts
).
to
eq
3
end
context
'with selective sync'
do
before
do
secondary
.
update!
(
selective_sync_type:
'namespaces'
,
namespaces:
[
synced_group
])
end
it
'counts job artifacts'
do
expect
(
subject
.
count_job_artifacts
).
to
eq
2
end
it
'ignores remote job artifacts'
do
job_artifact_1
.
update!
(
file_store:
ObjectStorage
::
Store
::
REMOTE
)
expect
(
subject
.
count_job_artifacts
).
to
eq
1
end
end
end
describe
'#count_synced_job_artifacts'
do
it
'counts job artifacts that have been synced'
do
create
(
:geo_file_registry
,
:job_artifact
,
file_id:
job_artifact_1
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:job_artifact
,
file_id:
job_artifact_2
.
id
)
create
(
:geo_file_registry
,
:job_artifact
,
file_id:
job_artifact_3
.
id
)
...
...
@@ -74,12 +133,6 @@ describe Geo::JobArtifactRegistryFinder, :geo do
end
describe
'#count_failed_job_artifacts'
do
it
'delegates to #legacy_find_failed_job_artifacts'
do
expect
(
subject
).
to
receive
(
:legacy_find_failed_job_artifacts
).
and_call_original
subject
.
count_failed_job_artifacts
end
it
'counts job artifacts that sync has failed'
do
create
(
:geo_file_registry
,
:job_artifact
,
file_id:
job_artifact_1
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:job_artifact
,
file_id:
job_artifact_2
.
id
)
...
...
@@ -131,6 +184,7 @@ describe Geo::JobArtifactRegistryFinder, :geo do
end
end
end
end
shared_examples
'finds all the things'
do
describe
'#find_unsynced_job_artifacts'
do
...
...
@@ -167,6 +221,8 @@ describe Geo::JobArtifactRegistryFinder, :geo do
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
::
Fdw
.
enabled?
end
include_examples
'counts all the things'
include_examples
'finds all the things'
do
let
(
:method_prefix
)
{
'fdw'
}
end
...
...
@@ -177,6 +233,8 @@ describe Geo::JobArtifactRegistryFinder, :geo do
allow
(
Gitlab
::
Geo
::
Fdw
).
to
receive
(
:enabled?
).
and_return
(
false
)
end
include_examples
'counts all the things'
include_examples
'finds all the things'
do
let
(
:method_prefix
)
{
'legacy'
}
end
...
...
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