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
bf8d2ea9
Commit
bf8d2ea9
authored
Aug 19, 2020
by
Dmitry Gruzd
Committed by
Dylan Griffith
Aug 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs to detect reindexing UI issues
parent
c4f7ce7d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
ee/spec/controllers/admin/application_settings_controller_spec.rb
...controllers/admin/application_settings_controller_spec.rb
+20
-0
ee/spec/views/admin/application_settings/_elasticsearch_form.html.haml_spec.rb
...pplication_settings/_elasticsearch_form.html.haml_spec.rb
+50
-0
No files found.
ee/spec/controllers/admin/application_settings_controller_spec.rb
View file @
bf8d2ea9
...
@@ -11,6 +11,26 @@ RSpec.describe Admin::ApplicationSettingsController do
...
@@ -11,6 +11,26 @@ RSpec.describe Admin::ApplicationSettingsController do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
end
end
describe
'GET #general'
do
before
do
sign_in
(
admin
)
end
context
'zero-downtime elasticsearch reindexing'
do
render_views
let!
(
:task
)
{
create
(
:elastic_reindexing_task
)
}
it
'assigns elasticsearch reindexing task'
do
get
:general
expect
(
assigns
(
:elasticsearch_reindexing_task
)).
to
eq
(
task
)
expect
(
response
.
body
).
to
include
(
'Reindexing status'
)
expect
(
response
.
body
).
to
include
(
"State:
#{
task
.
state
}
"
)
end
end
end
describe
'PUT #update'
do
describe
'PUT #update'
do
before
do
before
do
sign_in
(
admin
)
sign_in
(
admin
)
...
...
ee/spec/views/admin/application_settings/_elasticsearch_form.html.haml_spec.rb
View file @
bf8d2ea9
...
@@ -75,6 +75,56 @@ RSpec.describe 'admin/application_settings/_elasticsearch_form' do
...
@@ -75,6 +75,56 @@ RSpec.describe 'admin/application_settings/_elasticsearch_form' do
end
end
end
end
context
'zero-downtime elasticsearch reindexing'
do
let
(
:application_setting
)
{
build
(
:application_setting
)
}
before
do
assign
(
:elasticsearch_reindexing_task
,
task
)
end
context
'without extended details'
do
let
(
:task
)
{
build
(
:elastic_reindexing_task
)
}
it
'renders the task'
do
render
expect
(
rendered
).
to
include
(
"State:
#{
task
.
state
}
"
)
expect
(
rendered
).
not_to
include
(
"Task ID:"
)
expect
(
rendered
).
not_to
include
(
"Error:"
)
expect
(
rendered
).
not_to
include
(
"Expected documents:"
)
expect
(
rendered
).
not_to
include
(
"Documents reindexed:"
)
end
end
context
'with extended details'
do
let
(
:task
)
{
build
(
:elastic_reindexing_task
,
state: :reindexing
,
elastic_task:
'elastic-task-id'
,
error_message:
'error-message'
,
documents_count_target:
5
,
documents_count:
10
)
}
it
'renders the task'
do
render
expect
(
rendered
).
to
include
(
"State:
#{
task
.
state
}
"
)
expect
(
rendered
).
to
include
(
"Task ID:
#{
task
.
elastic_task
}
"
)
expect
(
rendered
).
to
include
(
"Error:
#{
task
.
error_message
}
"
)
expect
(
rendered
).
to
include
(
"Expected documents:
#{
task
.
documents_count
}
"
)
expect
(
rendered
).
to
include
(
"Documents reindexed:
#{
task
.
documents_count_target
}
(50.0%)"
)
end
end
context
'with extended details, but without documents_count_target'
do
let
(
:task
)
{
build
(
:elastic_reindexing_task
,
state: :reindexing
,
elastic_task:
'elastic-task-id'
,
documents_count:
10
)
}
it
'renders the task'
do
render
expect
(
rendered
).
to
include
(
"State:
#{
task
.
state
}
"
)
expect
(
rendered
).
to
include
(
"Task ID:
#{
task
.
elastic_task
}
"
)
expect
(
rendered
).
to
include
(
"Expected documents:
#{
task
.
documents_count
}
"
)
expect
(
rendered
).
not_to
include
(
"Error:"
)
expect
(
rendered
).
not_to
include
(
"Documents reindexed:"
)
end
end
end
context
'when there are elasticsearch indexed namespaces'
do
context
'when there are elasticsearch indexed namespaces'
do
let
(
:application_setting
)
{
build
(
:application_setting
,
elasticsearch_limit_indexing:
true
)
}
let
(
:application_setting
)
{
build
(
:application_setting
,
elasticsearch_limit_indexing:
true
)
}
...
...
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