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
7d0a610f
Commit
7d0a610f
authored
Jun 08, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve ES specs runtime
parent
10f20692
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
ee/lib/gitlab/elastic/helper.rb
ee/lib/gitlab/elastic/helper.rb
+6
-3
ee/spec/support/elastic.rb
ee/spec/support/elastic.rb
+1
-1
No files found.
ee/lib/gitlab/elastic/helper.rb
View file @
7d0a610f
...
...
@@ -28,16 +28,16 @@ module Gitlab
end
end
def
create_empty_index
(
with_alias:
true
)
def
create_empty_index
(
with_alias:
true
,
options:
{}
)
if
index_exists?
raise
"Index under '
#{
target_name
}
' already exists, use `recreate_index` to recreate it."
end
new_index_name
=
with_alias
?
"
#{
target_name
}
-
#{
Time
.
now
.
strftime
(
"%Y%m%d-%H%M"
)
}
"
:
target_name
settings
=
{}
mappings
=
{}
new_index_name
=
with_alias
?
"
#{
target_name
}
-
#{
Time
.
now
.
strftime
(
"%Y%m%d-%H%M"
)
}
"
:
target_name
[
Project
,
Issue
,
...
...
@@ -52,6 +52,9 @@ module Gitlab
mappings
.
deep_merge!
(
klass
.
__elasticsearch__
.
mappings
.
to_hash
)
end
settings
.
merge!
(
options
[
:settings
])
if
options
[
:settings
]
mappings
.
merge!
(
options
[
:mappings
])
if
options
[
:mappings
]
create_index_options
=
{
index:
new_index_name
,
body:
{
...
...
ee/spec/support/elastic.rb
View file @
7d0a610f
...
...
@@ -4,7 +4,7 @@ RSpec.configure do |config|
config
.
before
(
:each
,
:elastic
)
do
Elastic
::
ProcessBookkeepingService
.
clear_tracking!
Gitlab
::
Elastic
::
Helper
.
default
.
delete_index
Gitlab
::
Elastic
::
Helper
.
default
.
create_empty_index
Gitlab
::
Elastic
::
Helper
.
default
.
create_empty_index
(
options:
{
settings:
{
number_of_replicas:
0
}
})
end
config
.
after
(
:each
,
:elastic
)
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