-
Notifications
You must be signed in to change notification settings - Fork 309
Adapt CI to run with security enabled when testing with Elasticsearch > 8 #1039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,7 @@ def self.es_version | |
| end | ||
|
|
||
| def self.es_version_satisfies?(*requirement) | ||
| es_version = RSpec.configuration.filter[:es_version] || ENV['ES_VERSION'] || ENV['ELASTIC_STACK_VERSION'] | ||
| es_version = nilify(RSpec.configuration.filter[:es_version]) || nilify(ENV['ES_VERSION']) || nilify(ENV['ELASTIC_STACK_VERSION']) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for reviewer: if the single part of the concatenated |
||
| if es_version.nil? | ||
| puts "Info: ES_VERSION, ELASTIC_STACK_VERSION or 'es_version' tag wasn't set. Returning false to all `es_version_satisfies?` call." | ||
| return false | ||
|
|
@@ -89,6 +89,15 @@ def self.es_version_satisfies?(*requirement) | |
| Gem::Requirement.new(requirement).satisfied_by?(es_release_version) | ||
| end | ||
|
|
||
| private | ||
| def self.nilify(str) | ||
| if str.nil? | ||
| return str | ||
| end | ||
| str.empty? ? nil : str | ||
| end | ||
|
|
||
| public | ||
| def clean(client) | ||
| client.indices.delete_template(:name => "*") | ||
| client.indices.delete_index_template(:name => "logstash*") rescue nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewer: without this the
ENV['ELASTIC_STACK_VERSION']in Ruby code sees an empty String