Skip to content

Commit

Permalink
Add support for skipped tests
Browse files Browse the repository at this point in the history
Also skip three test that are waiting on an upstream change to the
Symfony Yaml Parser
  • Loading branch information
polyfractal committed Jan 24, 2014
1 parent 96f1b8b commit a9d3997
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a9d3997

Please sign in to comment.