Skip to content

Commit 914441c

Browse files
committed
More test fixes
Fixes #828
1 parent bbade7b commit 914441c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

spec/integration/outputs/compressed_indexing_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
describe "indexing with http_compression turned on", :integration => true do
1313
let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
1414
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
15-
let(:type) { 10.times.collect { rand(10).to_s }.join("") }
15+
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
1616
let(:event_count) { 10000 + rand(500) }
1717
let(:events) { event_count.times.map { event }.to_a }
1818
let(:config) {
@@ -50,8 +50,6 @@
5050
result = LogStash::Json.load(response.body)
5151
result["hits"]["hits"].each do |doc|
5252
if ESHelper.es_version_satisfies?(">= 6")
53-
expect(doc["_type"]).to eq(doc_type)
54-
else
5553
expect(doc["_type"]).to eq(type)
5654
end
5755
expect(doc["_index"]).to eq(index)

spec/integration/outputs/index_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
}
1414
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
15-
let(:type) { ESHelper.es_version_satisfies?("<= 6.3") ? "doc" : "_doc" }
15+
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
1616

1717
subject { LogStash::Outputs::ElasticSearch.new(config) }
1818

@@ -48,7 +48,7 @@
4848
describe "indexing" do
4949
let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
5050
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
51-
let(:type) { 10.times.collect { rand(10).to_s }.join("") }
51+
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
5252
let(:event_count) { 1 + rand(2) }
5353
let(:config) { "not implemented" }
5454
let(:events) { event_count.times.map { event }.to_a }
@@ -80,8 +80,6 @@
8080
result = LogStash::Json.load(response.body)
8181
result["hits"]["hits"].each do |doc|
8282
if ESHelper.es_version_satisfies?(">= 6")
83-
expect(doc["_type"]).to eq(doc_type)
84-
else
8583
expect(doc["_type"]).to eq(type)
8684
end
8785
expect(doc["_index"]).to eq(index)
@@ -120,7 +118,7 @@
120118
end
121119

122120
describe "an indexer with no type value set (default to doc)", :integration => true do
123-
let(:type) { "doc" }
121+
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
124122
let(:config) {
125123
{
126124
"hosts" => get_host_port,

spec/integration/outputs/parent_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
shared_examples "a join field based parent indexer" do
88
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
99

10-
let(:type) { ESHelper.es_version_satisfies?("<= 6.3") ? "doc" : "_doc" }
10+
let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
1111

1212
let(:event_count) { 10000 + rand(500) }
1313
let(:parent) { "not_implemented" }

0 commit comments

Comments
 (0)