mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Fix xpack integration tests to work with new ES hits format (#10220)
This commit is contained in:
parent
47e1bd252f
commit
a213a6f62a
2 changed files with 3 additions and 3 deletions
|
@ -33,6 +33,6 @@ describe "Monitoring is disabled" do
|
|||
let(:monitoring_index) { ".monitoring-logstash-2-*" }
|
||||
|
||||
it "doesn't record any metrics" do
|
||||
expect(elasticsearch_client.search(:index => monitoring_index)["hits"]["total"]).to eq(0)
|
||||
expect(elasticsearch_client.search(:index => monitoring_index)["hits"]["total"]["value"]).to eq(0)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ shared_examples "record monitoring data to es" do
|
|||
Stud.try(max_retry.times, retryable_errors) do
|
||||
elasticsearch_client.indices.refresh
|
||||
api_response = elasticsearch_client.search :index => MONITORING_INDEXES, :body => {:query => {:term => {"type" => "logstash_stats"}}}
|
||||
expect(api_response["hits"]["total"]).to be > 0
|
||||
expect(api_response["hits"]["total"]["value"]).to be > 0
|
||||
api_response["hits"]["hits"].each do |full_document|
|
||||
document = full_document["_source"]["logstash_stats"]
|
||||
expect(JSON::Validator.fully_validate(schema_file, document)).to be_empty
|
||||
|
@ -35,7 +35,7 @@ shared_examples "record monitoring data to es" do
|
|||
Stud.try(max_retry.times, retryable_errors) do
|
||||
elasticsearch_client.indices.refresh
|
||||
api_response = elasticsearch_client.search :index => MONITORING_INDEXES, :body => {:query => {:term => {"type" => "logstash_state"}}}
|
||||
expect(api_response["hits"]["total"]).to be > 0
|
||||
expect(api_response["hits"]["total"]["value"]).to be > 0
|
||||
api_response["hits"]["hits"].each do |full_document|
|
||||
document = full_document["_source"]["logstash_state"]
|
||||
expect(JSON::Validator.fully_validate(schema_file, document)).to be_empty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue