Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for 7.1.0 release #911

Merged
merged 5 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ matrix:
env: ES_VERSION="7.0.0"
- php: 7.3
env: ES_VERSION="7.0.0"
- php: 7.1
env: ES_VERSION="7.1.0"
- php: 7.2
env: ES_VERSION="7.1.0"
- php: 7.3
env: ES_VERSION="7.1.0"
- php: 7.3
env: ES_VERSION="7.2.0"
allow_failures:
- php: 7.3
env: ES_VERSION="7.1.0"
env: ES_VERSION="7.2.0"

env:
global:
Expand Down
8 changes: 8 additions & 0 deletions src/Elasticsearch/Connections/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ private function wrapHandler(callable $handler): callable
} else {
$connection->markAlive();

if (isset($response['headers']['Warning'])) {
$this->logWarning($request, $response);
}
if (isset($response['body']) === true) {
$response['body'] = stream_get_contents($response['body']);
$this->lastRequest['response']['body'] = $response['body'];
Expand Down Expand Up @@ -342,6 +345,11 @@ public function getHeaders(): array
return $this->headers;
}

public function logWarning(array $request, array $response): void
{
$this->log->warning('Deprecation', $response['headers']['Warning']);
}

/**
* Log a successful request
*
Expand Down
57 changes: 3 additions & 54 deletions tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,61 +66,26 @@ class YamlRunnerTest extends \PHPUnit\Framework\TestCase
];

private static $skippedTests = [
'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',
'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\'',
'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] ',
];

private static $skippedTestsIfPhpLessThan = [
// Failing on ES 6.7+ only with PHP 7.0: Cannot access empty property
'indices.put_mapping/11_basic_with_types.yml#Create index with invalid mappings' => '7.1.0',
'indices.put_mapping/10_basic.yml#Create index with invalid mappings' => '7.1.0',
'indices.create/11_basic_with_types.yml#Create index with invalid mappings' => '7.1.0',
'indices.create/11_basic_with_types.yml#Create index with no type mappings' => '7.1.0',
'indices.create/10_basic.yml#Create index with invalid mappings' => '7.1.0',
];
/**
* @var array A list of skipped test with their reasons
*/
private static $skippedFiles = [

'cat.nodeattrs/10_basic.yml' => 'Using java regex fails in PHP',
'cat.nodeattrs/10_basic.yaml' => 'Using java regex fails in PHP',

'cat.repositories/10_basic.yml' => 'Using java regex fails in PHP',
'cat.repositories/10_basic.yaml' => 'Using java regex fails in PHP',

'indices.shrink/10_basic.yml' => 'Shrink tests seem to require multiple nodes',
'indices.shrink/10_basic.yaml' => 'Shrink tests seem to require multiple nodes',

'indices.rollover/10_basic.yml' => 'Rollover test seems buggy atm',
'indices.rollover/10_basic.yaml' => 'Rollover test seems buggy atm',

'get_source/70_source_filtering.yml' => 'Expected [\'v1\'] does not match [false]',
'get_source/71_source_filtering_with_types.yml' => 'Expected [\'v1\'] does not match [false]',
'indices.rollover/10_basic.yml' => 'Rollover test seems buggy atm'
];

/**
* @var array A list of files to skip completely, due to fatal parsing errors
*/
private static $fatalFiles = [
'indices.create/10_basic.yml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
'indices.create/10_basic.yaml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',

'indices.put_mapping/10_basic.yml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',
'indices.put_mapping/10_basic.yaml' => 'Temporary: Yaml parser doesnt support "inline" empty keys',

'search/110_field_collapsing.yml' => 'Temporary: parse error, malformed inline yaml',
'search/110_field_collapsing.yaml' => 'Temporary: parse error, malformed inline yaml',
'range/10_basic.yml' => 'Temporary: parse error, malformed inline yaml',

'cat.nodes/10_basic.yml' => 'Temporary: parse error, something about $body: |',
'cat.nodes/10_basic.yaml' => 'Temporary: parse error, something about $body: |',
'search.aggregation/180_percentiles_tdigest_metric.yml' => 'array of objects, unclear how to fix',
'search.aggregation/190_percentiles_hdr_metric.yml' => 'array of objects, unclear how to fix',
'search/190_index_prefix_search.yml' => 'bad yaml array syntax',
'search.aggregation/230_composite.yml' => 'bad yaml array syntax',
'search/30_limits.yml' => 'bad regex'
'search.aggregation/230_composite.yml' => 'bad yaml array syntax'
];

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

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

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

Expand Down Expand Up @@ -1087,22 +1052,6 @@ private function clean()
$response = curl_exec($ch);
curl_close($ch);

$ch = curl_init($host."/_snapshot/*/*");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);

$response = curl_exec($ch);
curl_close($ch);

$ch = curl_init($host."/_snapshot/*");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);

$response = curl_exec($ch);
curl_close($ch);

$this->rmDirRecursively('/tmp/test_repo_create_1_loc');
$this->rmDirRecursively('/tmp/test_repo_restore_1_loc');
$this->rmDirRecursively('/tmp/test_cat_repo_1_loc');
Expand Down