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