Skip to content

Commit

Permalink
[TESTS] Update skiplist
Browse files Browse the repository at this point in the history
- null alias backwards compat break
- broken regex
  • Loading branch information
polyfractal committed Nov 24, 2014
1 parent 0dfbbb2 commit 60759a4
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function testYaml()
}

}
$this->executeTestCase($doc['values'], $testFile);
$this->executeTestCase($doc['values'], $testFile);

}

Expand All @@ -277,13 +277,13 @@ private function replaceWithStash($values, $stash)

if (is_array($values) === true) {
array_walk_recursive($values, function(&$item, $key) use ($stash) {
if (is_string($item) === true || is_numeric($item) === true) {
if (array_key_exists($item, $stash) == true) {
$item = $stash[$item];
}
if (is_string($item) === true || is_numeric($item) === true) {
if (array_key_exists($item, $stash) == true) {
$item = $stash[$item];
}
}

});
});
} elseif (is_string($values) || is_numeric($values)) {
if (array_key_exists($values, $stash) == true) {
$values = $stash[$values];
Expand Down Expand Up @@ -627,13 +627,14 @@ private function getTimestampRegex()
}

private function skipTest($path)
{
{//all_path_options
$skipList = array(
'indices.delete_mapping/all_path_options.yaml',
'indices.exists_type/10_basic.yaml',
'indices.get_mapping/10_basic.yaml',
'indices.create/10_basic.yaml',
'indices.get_alias/10_basic.yaml'
'indices.get_alias/10_basic.yaml',
'cat.allocation/10_basic.yaml' //regex breaks PHP
);

foreach ($skipList as $skip) {
Expand All @@ -642,6 +643,22 @@ private function skipTest($path)
}
}

//TODO make this more generic
if (version_compare(YamlRunnerTest::$esVersion, "1.4.0", "<")) {

// Breaking changes in null alias
$skipList = array(
'indices.delete_alias/all_path_options.yaml',
'indices.put_alias/10_basic.yaml'
);

foreach ($skipList as $skip) {
if (strpos($path, $skip) !== false) {
return true;
}
}
}

return false;
}

Expand Down

0 comments on commit 60759a4

Please sign in to comment.