Skip to content

Commit

Permalink
Split, refactor and fix some tests (#447)
Browse files Browse the repository at this point in the history
* Separate integration tests and refactor the YamlRunnerTest class

* Fix some tests on elasticsearch 5.0

* Fix typo

* Revert pipeline, add local skipping list, support features and add endpoint mapping
  • Loading branch information
joelwurtz authored and polyfractal committed Aug 11, 2016
1 parent d47b35e commit 68e819b
Show file tree
Hide file tree
Showing 10 changed files with 606 additions and 614 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ before_script:

script:
- vendor/bin/phpunit $PHPUNIT_FLAGS
- vendor/bin/phpunit -c phpunit-integration.xml $PHPUNIT_FLAGS

after_script:
- if [ $TRAVIS_PHP_VERSION = '7.0' ]; then php vendor/bin/coveralls; fi
14 changes: 5 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"require-dev": {
"phpunit/phpunit": "~4.7",
"mockery/mockery": "0.9.4",
"symfony/yaml": "2.4.3 as 2.4.2",
"symfony/yaml": "^2.8",
"symfony/finder": "^2.8",
"cpliakas/git-wrapper": "~1.0",
"sami/sami": "~3.2"
"sami/sami": "~3.2",
"doctrine/inflector": "^1.1"
},
"suggest": {
"ext-curl": "*",
Expand All @@ -34,11 +36,5 @@
"psr-4": {
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/polyfractal/Yaml"
}
]
}
}
23 changes: 23 additions & 0 deletions phpunit-integration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<phpunit
bootstrap="tests/bootstrap.php"
colors="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertErrorsToExceptions="true"
syntaxCheck="true"
verbose="true"
>
<php>
<env name="ES_TEST_HOST" value="http://localhost:9200"/>
</php>
<testsuites>
<testsuite>
<file>tests/Elasticsearch/Tests/YamlRunnerTest.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<testsuites>
<testsuite>
<directory>tests</directory>
<exclude>tests/Elasticsearch/Tests/YamlRunnerTest.php</exclude>
</testsuite>
</testsuites>
<filter>
Expand Down
3 changes: 2 additions & 1 deletion src/Elasticsearch/Endpoints/Cluster/AllocationExplain.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function getURI()
public function getParamWhitelist()
{
return array(
'include_yes_decisions'
'include_yes_decisions',
'include_disk_info',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Elasticsearch/Endpoints/Cluster/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getParamWhitelist()
'wait_for_nodes',
'wait_for_relocating_shards',
'wait_for_status',
'wait_for_events',
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Elasticsearch/Endpoints/Indices/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function getParamWhitelist()
return array(
'timeout',
'master_timeout',
'update_all_types'
'update_all_types',
'wait_for_active_shards'
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Elasticsearch/Endpoints/Indices/Rollover.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public function getParamWhitelist()
{
return array(
'timeout',
'master_timeout'
'master_timeout',
'wait_for_active_shards',
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Elasticsearch/Endpoints/Ingest/Pipeline/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function getURI()
'id is required for GetPipeline'
);
}

$id = $this->id;
$uri = "/_ingest/pipeline/$id";

Expand Down
Loading

0 comments on commit 68e819b

Please sign in to comment.