-
Notifications
You must be signed in to change notification settings - Fork 307
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
Adapt CI to run with security enabled when testing with Elasticsearch > 8 #1039
Conversation
xpack.security on Elasticsearch for integration testing
xpack.security on Elasticsearch for integration testingxpack.security setting on Elasticsearch for integration tests
…ty enabled by default
750b68f to
66184d6
Compare
…VERSION environment variable
xpack.security setting on Elasticsearch for integration tests| environment: | ||
| - INTEGRATION=${INTEGRATION:-false} | ||
| - SECURE_INTEGRATION=${SECURE_INTEGRATION:-false} | ||
| - ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION |
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
|
|
||
| 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']) |
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: if the single part of the concatenated || operator is an empty string then the result is that empty string. So if in the ENV there is a ES_VERSION but it's empty and the same for the first particle then the es_version assume the "" instead of the version of ELASTIC_STACK_VERSION
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.
lgtm
What does this PR do?
With Elasticsearch 8 the
xpack.securityis enabled by default, so updates the CI run withSECURE_INTEGRATION.This PR contains some fixes to expose the value of
ELASTIC_STACK_VERSIONin the Ruby'sENVand fixes fornilchecks when String versions are emptyHow to test