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
de7337f7
Commit
de7337f7
authored
Nov 22, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use existing rspec helper for DRYness
parent
acd2f8fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
17 deletions
+1
-17
spec/lib/gitlab/database/load_balancing/load_balancer_spec.rb
.../lib/gitlab/database/load_balancing/load_balancer_spec.rb
+1
-17
No files found.
spec/lib/gitlab/database/load_balancing/load_balancer_spec.rb
View file @
de7337f7
...
...
@@ -487,25 +487,9 @@ RSpec.describe Gitlab::Database::LoadBalancing::LoadBalancer, :request_store do
end
end
describe
'primary connection re-use'
,
:reestablished_active_record_base
do
describe
'primary connection re-use'
,
:reestablished_active_record_base
,
:add_ci_connection
do
let
(
:model
)
{
Ci
::
ApplicationRecord
}
around
do
|
example
|
if
Gitlab
::
Database
.
has_config?
(
:ci
)
example
.
run
else
# fake additional Database
model
.
establish_connection
(
ActiveRecord
::
DatabaseConfigurations
::
HashConfig
.
new
(
Rails
.
env
,
'ci'
,
ActiveRecord
::
Base
.
connection_db_config
.
configuration_hash
)
)
example
.
run
# Cleanup connection_specification_name for Ci::ApplicationRecord
model
.
remove_connection
end
end
describe
'#read'
do
it
'returns ci replica connection'
do
expect
{
|
b
|
lb
.
read
(
&
b
)
}.
to
yield_with_args
do
|
args
|
...
...
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