Skip to content

Commit fd6b8a9

Browse files
committed
Update mechanism to retrieve yaml tests
Migrating away from a pure-composer solution because it is too difficult to sync multiple branches/tests. Added a new RestSpecRunner which will checkout the appropriate commit/branch based on an env variable. In the future will add logic to also scan for locally running clusters and find the appropriate tests.
1 parent 47420ab commit fd6b8a9

File tree

5 files changed

+42
-18
lines changed

5 files changed

+42
-18
lines changed

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "util/elasticsearch"]
2+
path = util/elasticsearch
3+
url = https://github.com/elasticsearch/elasticsearch.git

Diff for: composer.json

+2-17
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,13 @@
2525
"satooshi/php-coveralls": "dev-master",
2626
"mikey179/vfsStream": "~1.2",
2727
"twig/twig": "1.*",
28-
"elasticsearch/elasticsearch_src" : "dev-master"
28+
"cpliakas/git-wrapper": "~1.0"
2929
},
3030
"autoload": {
3131
"psr-0": {
3232
"Elasticsearch": "src/",
3333
"Elasticsearch\\Tests" : "tests/",
3434
"Elasticsearch\\Benchmarks" : "benchmarks/"
3535
}
36-
},
37-
"repositories":[
38-
{
39-
"type":"package",
40-
"package":{
41-
"name":"elasticsearch/elasticsearch_src",
42-
"description":"elasticsearch",
43-
"version":"dev-master",
44-
"source":{
45-
"type" : "git",
46-
"url":"git://github.com/elasticsearch/elasticsearch.git",
47-
"reference" : "550c4079949baabef17e5a7845aadf36dccb41af"
48-
}
49-
}
50-
}
51-
]
36+
}
5237
}

Diff for: tests/Elasticsearch/Tests/YamlRunnerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function waitForYellow()
165165

166166
public static function provider()
167167
{
168-
$path = dirname(__FILE__).'/../../../vendor/elasticsearch/elasticsearch_src/rest-api-spec/test/';
168+
$path = dirname(__FILE__).'/../../../util/elasticsearch/rest-api-spec/test/';
169169

170170
$files = array();
171171
$objects = new RecursiveIteratorIterator(

Diff for: util/RestSpecRunner.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* User: zach
4+
* Date: 3/5/14
5+
* Time: 10:41 AM
6+
*/
7+
8+
error_reporting(E_ALL | E_STRICT);
9+
10+
// Set the default timezone. While this doesn't cause any tests to fail, PHP
11+
// complains if it is not set in 'date.timezone' of php.ini.
12+
date_default_timezone_set('UTC');
13+
14+
// Ensure that composer has installed all dependencies
15+
if (!file_exists(dirname(__DIR__) . '/composer.lock')) {
16+
die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n"
17+
. "See http://getcomposer.org for help with installing composer\n");
18+
}
19+
20+
// Include the composer autoloader
21+
$autoloader = require_once(dirname(__DIR__) . '/vendor/autoload.php');
22+
23+
24+
$gitWrapper = new \GitWrapper\GitWrapper();
25+
$git = $gitWrapper->workingCopy(dirname(__DIR__) . '/util/elasticsearch');
26+
27+
28+
29+
echo "Update elasticsearch submodule\n";
30+
$git->fetchAll(array('verbose' => true));
31+
32+
33+
$hash = $_SERVER['TEST_BUILD_REF'];
34+
echo "Checkout yaml tests (hash: $hash)\n";
35+
$git->checkout($hash, array('force' => true, 'quiet' => true));

Diff for: util/elasticsearch

Submodule elasticsearch added at 992747a

0 commit comments

Comments
 (0)