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
88e32f06
Commit
88e32f06
authored
Nov 13, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for rake elastic:create_empty_index
parent
01b5c0ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
ee/spec/tasks/elastic_rake_spec.rb
ee/spec/tasks/elastic_rake_spec.rb
+40
-0
No files found.
ee/spec/tasks/elastic_rake_spec.rb
0 → 100644
View file @
88e32f06
# frozen_string_literal: true
require
'rake_helper'
RSpec
.
describe
'elastic rake tasks'
,
:elastic
do
before
do
Rake
.
application
.
rake_require
'tasks/gitlab/elastic'
end
describe
'create_empty_index'
do
subject
{
run_rake_task
(
'gitlab:elastic:create_empty_index'
)
}
before
do
es_helper
.
delete_index
end
it
'creates an index'
do
expect
{
subject
}.
to
change
{
es_helper
.
index_exists?
}.
from
(
false
).
to
(
true
)
end
it
'marks all migrations as completed'
do
expect
(
Elastic
::
DataMigrationService
).
to
receive
(
:mark_all_as_completed!
).
and_call_original
expect
(
Elastic
::
MigrationRecord
.
persisted_versions
(
completed:
true
)).
to
eq
([])
subject
refresh_index!
migrations
=
Elastic
::
DataMigrationService
.
migrations
.
map
(
&
:version
)
expect
(
Elastic
::
MigrationRecord
.
persisted_versions
(
completed:
true
)).
to
eq
(
migrations
)
end
end
describe
'delete_index'
do
subject
{
run_rake_task
(
'gitlab:elastic:delete_index'
)
}
it
'removes the index'
do
expect
{
subject
}.
to
change
{
es_helper
.
index_exists?
}.
from
(
true
).
to
(
false
)
end
end
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