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
69987426
Commit
69987426
authored
Dec 03, 2018
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update elasticsearch system check to check for new supported versions
parent
f144d147
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
2 deletions
+69
-2
doc/integration/elasticsearch.md
doc/integration/elasticsearch.md
+1
-0
ee/changelogs/unreleased/elastic-version-check-fix.yml
ee/changelogs/unreleased/elastic-version-check-fix.yml
+5
-0
ee/lib/system_check/app/elasticsearch_check.rb
ee/lib/system_check/app/elasticsearch_check.rb
+11
-2
ee/spec/lib/system_check/app/elasticsearch_check_spec.rb
ee/spec/lib/system_check/app/elasticsearch_check_spec.rb
+52
-0
No files found.
doc/integration/elasticsearch.md
View file @
69987426
...
...
@@ -12,6 +12,7 @@ special searches:
-
[
Advanced Syntax Search
](
../user/search/advanced_search_syntax.md
)
## Version Requirements
<!-- Please remember to update ee/lib/system_check/app/elasticsearch_check.rb if this changes -->
| GitLab version | Elasticsearch version |
| -------------- | --------------------- |
...
...
ee/changelogs/unreleased/elastic-version-check-fix.yml
0 → 100644
View file @
69987426
---
title
:
Update elasticsearch system check to check for new supported versions
merge_request
:
8683
author
:
type
:
fixed
ee/lib/system_check/app/elasticsearch_check.rb
View file @
69987426
# frozen_string_literal: true
module
SystemCheck
module
App
class
ElasticsearchCheck
<
SystemCheck
::
BaseCheck
set_name
'Elasticsearch version 5.
1 - 5.5
?'
set_name
'Elasticsearch version 5.
6 - 6.x
?'
set_skip_reason
'skipped (elasticsearch is disabled)'
set_check_pass
->
{
"yes (
#{
self
.
current_version
}
)"
}
set_check_fail
->
{
"no (
#{
self
.
current_version
}
)"
}
...
...
@@ -18,7 +20,14 @@ module SystemCheck
end
def
check?
self
.
class
.
current_version
.
major
==
5
&&
(
1
..
5
).
cover?
(
self
.
class
.
current_version
.
minor
)
case
self
.
class
.
current_version
.
major
when
5
!
(
1
..
5
).
cover?
(
self
.
class
.
current_version
.
minor
)
when
6
true
else
false
end
end
def
show_error
...
...
ee/spec/lib/system_check/app/elasticsearch_check_spec.rb
0 → 100644
View file @
69987426
# frozen_string_literal: true
require
'spec_helper'
describe
SystemCheck
::
App
::
ElasticsearchCheck
do
describe
'#skip?'
do
context
'with elasticsearch disabled'
do
before
do
allow
(
Gitlab
::
CurrentSettings
.
current_application_settings
).
to
receive
(
:elasticsearch_indexing?
).
and_return
(
false
)
end
it
'returns true'
do
expect
(
described_class
.
new
.
skip?
).
to
eq
(
true
)
end
end
context
'with elasticsearch enabled'
do
before
do
allow
(
Gitlab
::
CurrentSettings
.
current_application_settings
).
to
receive
(
:elasticsearch_indexing?
).
and_return
(
true
)
end
it
'returns false'
do
expect
(
described_class
.
new
.
skip?
).
to
eq
(
false
)
end
end
end
describe
'#check?'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
described_class
.
new
.
check?
}
where
(
:version
,
:result
)
do
'2.3.0'
|
false
'5.3.1'
|
false
'5.6.0'
|
true
'5.6.6'
|
true
'6.0.0'
|
true
'6.3.4'
|
true
'7.1.0'
|
false
end
with_them
do
before
do
# `current_version` is memoized, so we must clear it out
described_class
.
instance_variable_set
(
:@current_version
,
nil
)
allow
(
Gitlab
::
Elastic
::
Client
).
to
receive
(
:build
).
and_return
(
double
(
info:
{
'version'
=>
{
'number'
=>
version
}
}))
end
it
{
is_expected
.
to
eq
(
result
)
}
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