Skip to content

Commit 87e32a4

Browse files
committed
Fixed dzil test for dist 7_0 sync
1 parent d2e3737 commit 87e32a4

File tree

11 files changed

+128
-164
lines changed

11 files changed

+128
-164
lines changed

dist-async/dist.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exclude_filename = dist.ini
1717
root = ../lib
1818
prefix = lib
1919
exclude_match = ^((?<!Async).)+$
20-
exclude_match = (Client/[0125]_)
20+
exclude_match = (Client/[01256]_)
2121

2222
[GatherDir / lib/Search/Elasticsearch/Cxn]
2323
root = ../lib/Search/Elasticsearch/Cxn
@@ -32,7 +32,7 @@ exclude_match = NetCurl.pm
3232
root = ../t
3333
prefix = t
3434
exclude_match = ^((?<!Async).)+$
35-
exclude_match = Client_[0125]
35+
exclude_match = Client_[01256]
3636
exclude_match = lib/
3737

3838
[GatherDir / t/lib]

dist/dist.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ exclude_match = Async
2121
exclude_match = AEHTTP.pm
2222
exclude_match = Mojo.pm
2323
exclude_match = Plugin/.*
24-
exclude_match = Client/[0125]_
24+
exclude_match = Client/[01256]_
2525

2626
[GatherDir / t]
2727
root = ../t
2828
prefix = t
2929
exclude_match = (?i:Async)
30-
exclude_match = (Client_[0125])
30+
exclude_match = (Client_[01256])
3131
exclude_match = netcurl
3232

3333
[PruneCruft]

lib/Search/Elasticsearch/Client/7_0/Role/API.pm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ sub api {
2626
params => {
2727
'_index' => '_index',
2828
'index' => '_index',
29-
'_type' => '_type',
30-
'type' => '_type',
3129
'_id' => '_id',
3230
'id' => '_id',
3331
'pipeline' => 'pipeline',
@@ -57,7 +55,7 @@ sub api {
5755
'upsert',
5856
]
5957
},
60-
'bulk.required' => { params => [ 'index', 'type' ] },
58+
'bulk.required' => { params => [ 'index' ] },
6159

6260
#=== AUTOGEN - START ===
6361

@@ -658,14 +656,15 @@ sub api {
658656
'scroll' => {
659657
body => {},
660658
doc => "",
661-
parts => { scroll_id => {} },
659+
parts => {},
662660
paths => [ [ {}, "_search", "scroll" ] ],
663661
qs => {
664662
error_trace => "boolean",
665663
filter_path => "list",
666664
human => "boolean",
667665
rest_total_hits_as_int => "boolean",
668666
scroll => "time",
667+
scroll_id => "string",
669668
},
670669
},
671670

t/Client_7_0/15_conflict .t

Lines changed: 0 additions & 29 deletions
This file was deleted.

t/Client_7_0/30_bulk_add_action.t

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ok $b->add_action(), 'Empty add action';
2020
ok $b->add_action(
2121
index => {
2222
index => 'foo',
23-
type => 'bar',
2423
id => 1,
2524
pipeline => 'foo',
2625
routing => 1,
@@ -33,7 +32,6 @@ ok $b->add_action(
3332
},
3433
index => {
3534
_index => 'foo',
36-
_type => 'bar',
3735
_id => 2,
3836
_routing => 2,
3937
_parent => 2,
@@ -49,14 +47,14 @@ ok $b->add_action(
4947

5048
cmp_deeply $b->_buffer,
5149
[
52-
q({"index":{"_id":1,"_index":"foo","_type":"bar","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
50+
q({"index":{"_id":1,"_index":"foo","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
5351
q({"foo":"bar"}),
54-
q({"index":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
52+
q({"index":{"_id":2,"_index":"foo","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
5553
q({"foo":"bar"})
5654
],
5755
"Index actions in buffer";
5856

59-
is $b->_buffer_size, 341, "Index actions buffer size";
57+
is $b->_buffer_size, 313, "Index actions buffer size";
6058
is $b->_buffer_count, 2, "Index actions buffer count";
6159

6260
$b->clear_buffer;
@@ -66,7 +64,6 @@ $b->clear_buffer;
6664
ok $b->add_action(
6765
create => {
6866
index => 'foo',
69-
type => 'bar',
7067
id => 1,
7168
routing => 1,
7269
parent => 1,
@@ -79,7 +76,6 @@ ok $b->add_action(
7976
},
8077
create => {
8178
_index => 'foo',
82-
_type => 'bar',
8379
_id => 2,
8480
_routing => 2,
8581
_parent => 2,
@@ -94,14 +90,14 @@ ok $b->add_action(
9490

9591
cmp_deeply $b->_buffer,
9692
[
97-
q({"create":{"_id":1,"_index":"foo","_type":"bar","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
93+
q({"create":{"_id":1,"_index":"foo","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
9894
q({"foo":"bar"}),
99-
q({"create":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
95+
q({"create":{"_id":2,"_index":"foo","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
10096
q({"foo":"bar"})
10197
],
10298
"Create actions in buffer";
10399

104-
is $b->_buffer_size, 343, "Create actions buffer size";
100+
is $b->_buffer_size, 315, "Create actions buffer size";
105101
is $b->_buffer_count, 2, "Create actions buffer count";
106102

107103
$b->clear_buffer;
@@ -111,7 +107,6 @@ $b->clear_buffer;
111107
ok $b->add_action(
112108
delete => {
113109
index => 'foo',
114-
type => 'bar',
115110
id => 1,
116111
routing => 1,
117112
parent => 1,
@@ -120,7 +115,6 @@ ok $b->add_action(
120115
},
121116
delete => {
122117
_index => 'foo',
123-
_type => 'bar',
124118
_id => 2,
125119
_routing => 2,
126120
_parent => 2,
@@ -132,12 +126,12 @@ ok $b->add_action(
132126

133127
cmp_deeply $b->_buffer,
134128
[
135-
q({"delete":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"version":1,"version_type":"external"}}),
136-
q({"delete":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"version":1,"version_type":"external"}}),
129+
q({"delete":{"_id":1,"_index":"foo","parent":1,"routing":1,"version":1,"version_type":"external"}}),
130+
q({"delete":{"_id":2,"_index":"foo","parent":2,"routing":2,"version":1,"version_type":"external"}}),
137131
],
138132
"Delete actions in buffer";
139133

140-
is $b->_buffer_size, 222, "Delete actions buffer size";
134+
is $b->_buffer_size, 194, "Delete actions buffer size";
141135
is $b->_buffer_count, 2, "Delete actions buffer count";
142136

143137
$b->clear_buffer;
@@ -147,7 +141,6 @@ $b->clear_buffer;
147141
ok $b->add_action(
148142
update => {
149143
index => 'foo',
150-
type => 'bar',
151144
id => 1,
152145
routing => 1,
153146
parent => 1,
@@ -168,7 +161,6 @@ ok $b->add_action(
168161
},
169162
update => {
170163
_index => 'foo',
171-
_type => 'bar',
172164
_id => 1,
173165
_routing => 1,
174166
_parent => 1,
@@ -192,14 +184,14 @@ ok $b->add_action(
192184

193185
cmp_deeply $b->_buffer,
194186
[
195-
q({"update":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
187+
q({"update":{"_id":1,"_index":"foo","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
196188
q({"_source":"true","_source_excludes":["bar"],"_source_includes":["foo"],"detect_noop":"true","doc":{"foo":"bar"},"doc_as_upsert":1,"fields":["*"],"retry_on_conflict":3,"script":"ctx._source+=1","scripted_upsert":"true"}),
197-
q({"update":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
189+
q({"update":{"_id":1,"_index":"foo","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
198190
q({"_source":"true","_source_excludes":["bar"],"_source_includes":["foo"],"detect_noop":"true","doc":{"foo":"bar"},"doc_as_upsert":1,"fields":["*"],"retry_on_conflict":3,"script":"ctx._source+=1","scripted_upsert":"true"})
199191
],
200192
"Update actions in buffer";
201193

202-
is $b->_buffer_size, 738, "Update actions buffer size";
194+
is $b->_buffer_size, 710, "Update actions buffer size";
203195
is $b->_buffer_count, 2, "Update actions buffer count";
204196

205197
$b->clear_buffer;
@@ -211,16 +203,14 @@ throws_ok { $b->add_action( 'foo' => {} ) } qr/Unrecognised action/,
211203
throws_ok { $b->add_action( 'index', 'bar' ) } qr/Missing <params>/,
212204
'Missing params';
213205

214-
throws_ok { $b->add_action( index => { type => 't' } ) }
206+
throws_ok { $b->add_action( index => { } ) }
215207
qr/Missing .*<index>/, 'Missing index';
216208
throws_ok { $b->add_action( index => { index => 'i' } ) }
217-
qr/Missing .*<type>/, 'Missing type';
218-
throws_ok { $b->add_action( index => { index => 'i', type => 't' } ) }
219209
qr/Missing <source>/, 'Missing source';
220210

221211
throws_ok {
222212
$b->add_action(
223-
index => { index => 'i', type => 't', source => {}, foo => 1 } );
213+
index => { index => 'i', source => {}, foo => 1 } );
224214
}
225215
qr/Unknown params/, 'Unknown params';
226216

t/Client_7_0/31_bulk_helpers.t

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use lib 't/lib';
88
$ENV{ES_VERSION} = '7_0';
99
my $es = do "es_sync.pl" or die( $@ || $! );
1010
my $b = $es->bulk_helper(
11-
index => 'i',
12-
type => 't'
11+
index => 'i'
1312
);
1413
my $s = $b->_serializer;
1514
$s->_set_canonical;
@@ -20,7 +19,6 @@ ok $b->index(), 'Empty index';
2019

2120
ok $b->index(
2221
{ index => 'foo',
23-
type => 'bar',
2422
id => 1,
2523
pipeline => 'foo',
2624
routing => 1,
@@ -32,7 +30,6 @@ ok $b->index(
3230
source => { foo => 'bar' },
3331
},
3432
{ _index => 'foo',
35-
_type => 'bar',
3633
_id => 2,
3734
_routing => 2,
3835
_parent => 2,
@@ -48,14 +45,14 @@ ok $b->index(
4845

4946
cmp_deeply $b->_buffer,
5047
[
51-
q({"index":{"_id":1,"_index":"foo","_type":"bar","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
48+
q({"index":{"_id":1,"_index":"foo","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
5249
q({"foo":"bar"}),
53-
q({"index":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
50+
q({"index":{"_id":2,"_index":"foo","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
5451
q({"foo":"bar"})
5552
],
5653
"Index in buffer";
5754

58-
is $b->_buffer_size, 341, "Index buffer size";
55+
is $b->_buffer_size, 313, "Index buffer size";
5956
is $b->_buffer_count, 2, "Index buffer count";
6057

6158
$b->clear_buffer;
@@ -66,7 +63,6 @@ ok $b->create(), 'Create empty';
6663

6764
ok $b->create(
6865
{ index => 'foo',
69-
type => 'bar',
7066
id => 1,
7167
routing => 1,
7268
parent => 1,
@@ -78,7 +74,6 @@ ok $b->create(
7874
source => { foo => 'bar' },
7975
},
8076
{ _index => 'foo',
81-
_type => 'bar',
8277
_id => 2,
8378
_routing => 2,
8479
_parent => 2,
@@ -93,14 +88,14 @@ ok $b->create(
9388

9489
cmp_deeply $b->_buffer,
9590
[
96-
q({"create":{"_id":1,"_index":"foo","_type":"bar","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
91+
q({"create":{"_id":1,"_index":"foo","parent":1,"pipeline":"foo","routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
9792
q({"foo":"bar"}),
98-
q({"create":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
93+
q({"create":{"_id":2,"_index":"foo","parent":2,"routing":2,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
9994
q({"foo":"bar"})
10095
],
10196
"Create actions in buffer";
10297

103-
is $b->_buffer_size, 343, "Create actions buffer size";
98+
is $b->_buffer_size, 315, "Create actions buffer size";
10499
is $b->_buffer_count, 2, "Create actions buffer count";
105100

106101
$b->clear_buffer;
@@ -125,15 +120,13 @@ ok $b->delete(), 'Delete empty';
125120

126121
ok $b->delete(
127122
{ index => 'foo',
128-
type => 'bar',
129123
id => 1,
130124
routing => 1,
131125
parent => 1,
132126
version => 1,
133127
version_type => 'external',
134128
},
135129
{ _index => 'foo',
136-
_type => 'bar',
137130
_id => 2,
138131
_routing => 2,
139132
_parent => 2,
@@ -145,12 +138,12 @@ ok $b->delete(
145138

146139
cmp_deeply $b->_buffer,
147140
[
148-
q({"delete":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"version":1,"version_type":"external"}}),
149-
q({"delete":{"_id":2,"_index":"foo","_type":"bar","parent":2,"routing":2,"version":1,"version_type":"external"}}),
141+
q({"delete":{"_id":1,"_index":"foo","parent":1,"routing":1,"version":1,"version_type":"external"}}),
142+
q({"delete":{"_id":2,"_index":"foo","parent":2,"routing":2,"version":1,"version_type":"external"}}),
150143
],
151144
"Delete actions in buffer";
152145

153-
is $b->_buffer_size, 222, "Delete actions buffer size";
146+
is $b->_buffer_size, 194, "Delete actions buffer size";
154147
is $b->_buffer_count, 2, "Delete actions buffer count";
155148

156149
$b->clear_buffer;
@@ -176,7 +169,6 @@ $b->clear_buffer;
176169
ok $b->update(), 'Update empty';
177170
ok $b->update(
178171
{ index => 'foo',
179-
type => 'bar',
180172
id => 1,
181173
routing => 1,
182174
parent => 1,
@@ -196,7 +188,6 @@ ok $b->update(
196188
retry_on_conflict => 3,
197189
},
198190
{ _index => 'foo',
199-
_type => 'bar',
200191
_id => 1,
201192
_routing => 1,
202193
_parent => 1,
@@ -220,14 +211,14 @@ ok $b->update(
220211

221212
cmp_deeply $b->_buffer,
222213
[
223-
q({"update":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
214+
q({"update":{"_id":1,"_index":"foo","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
224215
q({"_source":"true","_source_excludes":["bar"],"_source_includes":["foo"],"detect_noop":"true","doc":{"foo":"bar"},"doc_as_upsert":1,"fields":["*"],"retry_on_conflict":3,"script":"ctx._source+=1","scripted_upsert":"true"}),
225-
q({"update":{"_id":1,"_index":"foo","_type":"bar","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
216+
q({"update":{"_id":1,"_index":"foo","parent":1,"routing":1,"timestamp":1380019061000,"ttl":"10m","version":1,"version_type":"external"}}),
226217
q({"_source":"true","_source_excludes":["bar"],"_source_includes":["foo"],"detect_noop":"true","doc":{"foo":"bar"},"doc_as_upsert":1,"fields":["*"],"retry_on_conflict":3,"script":"ctx._source+=1","scripted_upsert":"true"})
227218
],
228219
"Update actions in buffer";
229220

230-
is $b->_buffer_size, 738, "Update actions buffer size";
221+
is $b->_buffer_size, 710, "Update actions buffer size";
231222
is $b->_buffer_count, 2, "Update actions buffer count";
232223

233224
$b->clear_buffer;

0 commit comments

Comments
 (0)