Skip to content

Commit

Permalink
fix secure integration spec tagging (elastic#773)
Browse files Browse the repository at this point in the history
* fix secure integration spec tagging

by default devutils exludes a set of spec tags but that set doesn't
include this plugin's "secure_integration" tag. This PR adds that tag
to the default set of exclusions.

* handle missing ES_VERSION variable

* handle lack of es version in specs
  • Loading branch information
jsvd committed May 22, 2018
1 parent 5a36751 commit 8903904
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions spec/es_spec_helper.rb
Expand Up @@ -2,6 +2,12 @@
require 'manticore'
require 'elasticsearch'

# by default exclude secure_integration tests unless requested
# normal integration specs are already excluded by devutils' spec helper
RSpec.configure do |config|
config.filter_run_excluding config.exclusion_filter.add(:secure_integration => true)
end

module ESHelper
def get_host_port
"127.0.0.1:9200"
Expand All @@ -17,6 +23,10 @@ def self.es_version

def self.es_version_satisfies?(*requirement)
es_version = RSpec.configuration.filter[:es_version] || ENV['ES_VERSION']
if es_version.nil?
puts "Info: ES_VERSION environment or 'es_version' tag wasn't set. Returning false to all `es_version_satisfies?` call."
return false
end
es_release_version = Gem::Version.new(es_version).release
Gem::Requirement.new(requirement).satisfied_by?(es_release_version)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/outputs/index_spec.rb
Expand Up @@ -129,7 +129,7 @@
it_behaves_like("an indexer")
end

describe "a secured indexer", :elasticsearch_secure => true do
describe "a secured indexer", :secure_integration => true do
let(:user) { "simpleuser" }
let(:password) { "abc123" }
let(:cacert) { "spec/fixtures/test_certs/test.crt" }
Expand Down

0 comments on commit 8903904

Please sign in to comment.