Skip to content

Commit 220955d

Browse files
committed
Merge branch 'prep-release/7.1.0'
2 parents b875f6e + 9ef60c8 commit 220955d

File tree

3 files changed

+18
-55
lines changed

3 files changed

+18
-55
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ matrix:
1818
env: ES_VERSION="7.0.0"
1919
- php: 7.3
2020
env: ES_VERSION="7.0.0"
21+
- php: 7.1
22+
env: ES_VERSION="7.1.0"
23+
- php: 7.2
24+
env: ES_VERSION="7.1.0"
2125
- php: 7.3
2226
env: ES_VERSION="7.1.0"
27+
- php: 7.3
28+
env: ES_VERSION="7.2.0"
2329
allow_failures:
2430
- php: 7.3
25-
env: ES_VERSION="7.1.0"
31+
env: ES_VERSION="7.2.0"
2632

2733
env:
2834
global:

src/Elasticsearch/Connections/Connection.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ private function wrapHandler(callable $handler): callable
283283
} else {
284284
$connection->markAlive();
285285

286+
if (isset($response['headers']['Warning'])) {
287+
$this->logWarning($request, $response);
288+
}
286289
if (isset($response['body']) === true) {
287290
$response['body'] = stream_get_contents($response['body']);
288291
$this->lastRequest['response']['body'] = $response['body'];
@@ -342,6 +345,11 @@ public function getHeaders(): array
342345
return $this->headers;
343346
}
344347

348+
public function logWarning(array $request, array $response): void
349+
{
350+
$this->log->warning('Deprecation', $response['headers']['Warning']);
351+
}
352+
345353
/**
346354
* Log a successful request
347355
*

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -66,61 +66,26 @@ class YamlRunnerTest extends \PHPUnit\Framework\TestCase
6666
];
6767

6868
private static $skippedTests = [
69-
'nodes.stats/30_discovery.yml#Discovery stats' => 'Failing on ES 6.1+: nodes.$master.discovery is an empty array, expected to have cluster_state_queue field in it',
70-
'indices.stats/20_translog.yml#Translog retention' => 'Failing on ES 6.3+: Failed asserting that 495 is equal to <string:$creation_size> or is less than \'$creation_size\'',
71-
'indices.shrink/30_copy_settings.yml#Copy settings during shrink index' => 'Failing on ES 6.4+: Failed to match in test "Copy settings during shrink index". Expected [\'4\'] does not match [false] ',
7269
];
7370

7471
private static $skippedTestsIfPhpLessThan = [
75-
// Failing on ES 6.7+ only with PHP 7.0: Cannot access empty property
76-
'indices.put_mapping/11_basic_with_types.yml#Create index with invalid mappings' => '7.1.0',
77-
'indices.put_mapping/10_basic.yml#Create index with invalid mappings' => '7.1.0',
78-
'indices.create/11_basic_with_types.yml#Create index with invalid mappings' => '7.1.0',
79-
'indices.create/11_basic_with_types.yml#Create index with no type mappings' => '7.1.0',
80-
'indices.create/10_basic.yml#Create index with invalid mappings' => '7.1.0',
8172
];
8273
/**
8374
* @var array A list of skipped test with their reasons
8475
*/
8576
private static $skippedFiles = [
86-
8777
'cat.nodeattrs/10_basic.yml' => 'Using java regex fails in PHP',
88-
'cat.nodeattrs/10_basic.yaml' => 'Using java regex fails in PHP',
89-
9078
'cat.repositories/10_basic.yml' => 'Using java regex fails in PHP',
91-
'cat.repositories/10_basic.yaml' => 'Using java regex fails in PHP',
92-
93-
'indices.shrink/10_basic.yml' => 'Shrink tests seem to require multiple nodes',
94-
'indices.shrink/10_basic.yaml' => 'Shrink tests seem to require multiple nodes',
95-
96-
'indices.rollover/10_basic.yml' => 'Rollover test seems buggy atm',
97-
'indices.rollover/10_basic.yaml' => 'Rollover test seems buggy atm',
98-
99-
'get_source/70_source_filtering.yml' => 'Expected [\'v1\'] does not match [false]',
100-
'get_source/71_source_filtering_with_types.yml' => 'Expected [\'v1\'] does not match [false]',
79+
'indices.rollover/10_basic.yml' => 'Rollover test seems buggy atm'
10180
];
10281

10382
/**
10483
* @var array A list of files to skip completely, due to fatal parsing errors
10584
*/
10685
private static $fatalFiles = [
107-
'indices.create/10_basic.yml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
108-
'indices.create/10_basic.yaml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
109-
110-
'indices.put_mapping/10_basic.yml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
111-
'indices.put_mapping/10_basic.yaml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
112-
11386
'search/110_field_collapsing.yml' => 'Temporary: parse error, malformed inline yaml',
114-
'search/110_field_collapsing.yaml' => 'Temporary: parse error, malformed inline yaml',
115-
'range/10_basic.yml' => 'Temporary: parse error, malformed inline yaml',
116-
117-
'cat.nodes/10_basic.yml' => 'Temporary: parse error, something about $body: |',
118-
'cat.nodes/10_basic.yaml' => 'Temporary: parse error, something about $body: |',
119-
'search.aggregation/180_percentiles_tdigest_metric.yml' => 'array of objects, unclear how to fix',
120-
'search.aggregation/190_percentiles_hdr_metric.yml' => 'array of objects, unclear how to fix',
12187
'search/190_index_prefix_search.yml' => 'bad yaml array syntax',
122-
'search.aggregation/230_composite.yml' => 'bad yaml array syntax',
123-
'search/30_limits.yml' => 'bad regex'
88+
'search.aggregation/230_composite.yml' => 'bad yaml array syntax'
12489
];
12590

12691
/**
@@ -843,7 +808,7 @@ public function yamlProvider(): array
843808
$finder->name('*.yml');
844809

845810
// *.yaml files should be included until the library is ES 6.0+ only
846-
$finder->name('*.yaml');
811+
//$finder->name('*.yaml');
847812

848813
$filter = getenv('TEST_CASE') !== false ? getenv('TEST_CASE') : null;
849814

@@ -1087,22 +1052,6 @@ private function clean()
10871052
$response = curl_exec($ch);
10881053
curl_close($ch);
10891054

1090-
$ch = curl_init($host."/_snapshot/*/*");
1091-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1092-
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
1093-
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
1094-
1095-
$response = curl_exec($ch);
1096-
curl_close($ch);
1097-
1098-
$ch = curl_init($host."/_snapshot/*");
1099-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1100-
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
1101-
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
1102-
1103-
$response = curl_exec($ch);
1104-
curl_close($ch);
1105-
11061055
$this->rmDirRecursively('/tmp/test_repo_create_1_loc');
11071056
$this->rmDirRecursively('/tmp/test_repo_restore_1_loc');
11081057
$this->rmDirRecursively('/tmp/test_cat_repo_1_loc');

0 commit comments

Comments
 (0)