Maintenance: ElasticSearch 7.8+ supported

This commit is contained in:
Mantas Masalskis 2021-07-14 14:04:54 +00:00 committed by Thorsten Eckel
parent 869a9a5632
commit fd5be086ec
2 changed files with 6 additions and 16 deletions

View file

@ -13,26 +13,14 @@
- bundle exec rspec --tag searchindex --tag ~type:system - bundle exec rspec --tag searchindex --tag ~type:system
- bundle exec rails test test/integration/report_test.rb - bundle exec rails test test/integration/report_test.rb
es:6:
<<: *template_integration_es
variables:
ELASTICSEARCH_TAG: '6'
RAILS_ENV: "test"
es:6.5:
<<: *template_integration_es
variables:
ELASTICSEARCH_TAG: '6.5'
RAILS_ENV: "test"
es:7: es:7:
<<: *template_integration_es <<: *template_integration_es
variables: variables:
ELASTICSEARCH_TAG: '7' ELASTICSEARCH_TAG: '7'
RAILS_ENV: "test" RAILS_ENV: "test"
es:7.0: es:7.8:
<<: *template_integration_es <<: *template_integration_es
variables: variables:
ELASTICSEARCH_TAG: '7.0' ELASTICSEARCH_TAG: '7.8.1'
RAILS_ENV: "test" RAILS_ENV: "test"

View file

@ -20,10 +20,12 @@ info about used search index machine
installed_version = response.data.dig('version', 'number') installed_version = response.data.dig('version', 'number')
raise "Unable to get elasticsearch version from response: #{response.inspect}" if installed_version.blank? raise "Unable to get elasticsearch version from response: #{response.inspect}" if installed_version.blank?
version_supported = Gem::Version.new(installed_version) < Gem::Version.new('8') installed_version_parsed = Gem::Version.new(installed_version)
version_supported = installed_version_parsed < Gem::Version.new('8')
raise "Version #{installed_version} of configured elasticsearch is not supported." if !version_supported raise "Version #{installed_version} of configured elasticsearch is not supported." if !version_supported
version_supported = Gem::Version.new(installed_version) > Gem::Version.new('2.3') version_supported = installed_version_parsed >= Gem::Version.new('7.8')
raise "Version #{installed_version} of configured elasticsearch is not supported." if !version_supported raise "Version #{installed_version} of configured elasticsearch is not supported." if !version_supported
return response.data return response.data