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
1d53cb06
Commit
1d53cb06
authored
Feb 17, 2022
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ci decomposed issues with force_no_sharing_primary_model
parent
cdb704ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
spec/lib/gitlab/database/load_balancing/configuration_spec.rb
.../lib/gitlab/database/load_balancing/configuration_spec.rb
+0
-7
spec/spec_helper.rb
spec/spec_helper.rb
+14
-0
No files found.
spec/lib/gitlab/database/load_balancing/configuration_spec.rb
View file @
1d53cb06
...
...
@@ -7,13 +7,6 @@ RSpec.describe Gitlab::Database::LoadBalancing::Configuration, :request_store do
let
(
:db_config
)
{
ActiveRecord
::
DatabaseConfigurations
::
HashConfig
.
new
(
'test'
,
'ci'
,
configuration_hash
)
}
let
(
:model
)
{
double
(
:model
,
connection_db_config:
db_config
)
}
before
do
# It's confusing to think about these specs with this enabled by default so
# we make it disabled by default and just write the specific spec for when
# it's enabled
stub_feature_flags
(
force_no_sharing_primary_model:
false
)
end
describe
'.for_model'
do
context
'when load balancing is not configured'
do
it
'uses the default settings'
do
...
...
spec/spec_helper.rb
View file @
1d53cb06
...
...
@@ -252,6 +252,20 @@ RSpec.configure do |config|
::
Ci
::
ApplicationRecord
.
set_open_transactions_baseline
end
config
.
around
do
|
example
|
if
example
.
metadata
.
fetch
(
:stub_feature_flags
,
true
)
# It doesn't make sense for this to default to enabled as we only plan to
# use this temporarily to override an environment variable but eventually
# we'll just use the environment variable value when we've completed the
# gradual rollout. This stub must happen in around block as there are other
# around blocks in tests that will run before this and get the wrong
# database connection.
stub_feature_flags
(
force_no_sharing_primary_model:
false
)
end
example
.
run
end
config
.
append_after
do
ApplicationRecord
.
reset_open_transactions_baseline
::
Ci
::
ApplicationRecord
.
reset_open_transactions_baseline
...
...
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