diff --git a/tests/Elasticsearch/Tests/YamlRunnerTest.php b/tests/Elasticsearch/Tests/YamlRunnerTest.php index e03fb6087..fb38a717d 100644 --- a/tests/Elasticsearch/Tests/YamlRunnerTest.php +++ b/tests/Elasticsearch/Tests/YamlRunnerTest.php @@ -170,7 +170,8 @@ public static function provider() /** @var FilesystemIterator $object */ if ($object->isFile() === true && $object->getFilename() !== 'README.asciidoc' && $object->getFilename() !== 'TODO.txt') { - $files[] = array($object->getPathInfo()->getRealPath()."/".$object->getBasename()); + $path = $object->getPathInfo()->getRealPath()."/".$object->getBasename(); + $files[] = array($path); } } @@ -201,6 +202,10 @@ public function testYaml() echo "$testFile\n"; ob_flush(); + if ($this->skipTest($testFile) === true) { + $this->markTestSkipped('Skipped due to skip-list'); + } + $fileData = file_get_contents($testFile); $documents = array_filter(explode("---", $fileData)); @@ -525,6 +530,23 @@ private function getTimestampRegex() EOF; } + private function skipTest($path) + { + $skipList = array( + 'indices.delete_mapping/all_path_options.yaml', + 'indices.exists_type/10_basic.yaml', + 'indices.get_mapping/10_basic.yaml' + ); + + foreach ($skipList as $skip) { + if (strpos($path, $skip) !== false) { + return true; + } + } + + return false; + } + } class SetupSkipException extends \Exception