Skip to content

Commit c12fcf7

Browse files
committed
Fix integration tests using docker
1 parent 3b77366 commit c12fcf7

19 files changed

+191
-156
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ Thumbs.db
2121
generator/*
2222

2323
# Elasticsearch related
24-
util/elasticsearch/
24+
util/elasticsearch
2525
util/cache/
2626
util/output
2727

2828
# Sami docs generator
2929
/sami.phar
30+
31+
# PHPUnit
32+
/phpunit.xml

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
language: php
22

3-
jdk:
4-
- oraclejdk8
5-
6-
addons:
7-
apt:
8-
packages:
9-
- oracle-java8-installer
3+
services:
4+
- docker
105

116
branches:
127
except:
@@ -43,11 +38,9 @@ matrix:
4338
env:
4439
global:
4540
- ES_TEST_HOST=http://localhost:9200
46-
- JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
4741

4842
before_install:
49-
- sudo update-java-alternatives -s java-8-oracle
50-
- ./travis/download_and_run_es.sh
43+
- ./travis/run_es_docker.sh
5144

5245
install:
5346
- composer install --prefer-dist
@@ -65,3 +58,6 @@ script:
6558

6659
after_script:
6760
- if [ $TRAVIS_PHP_VERSION = '7.3' ]; then php vendor/bin/coveralls; fi
61+
62+
notifications:
63+
email: true

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"license": "Apache-2.0",
77
"authors": [
88
{
9-
"name": "Zachary Tong"
9+
"name": "Zachary Tong"
10+
},
11+
{
12+
"name": "Enrico Zimuel"
1013
}
1114
],
1215
"require": {
@@ -18,8 +21,8 @@
1821
"require-dev": {
1922
"cpliakas/git-wrapper": "~1.0",
2023
"doctrine/inflector": "^1.1",
21-
"mockery/mockery": "0.9.4",
22-
"phpstan/phpstan-shim": "0.9.1",
24+
"mockery/mockery": "^1.2",
25+
"phpstan/phpstan-shim": "^0.9",
2326
"phpunit/phpunit": "6.3.0",
2427
"squizlabs/php_codesniffer": "3.0.2",
2528
"symfony/finder": "^2.8",
@@ -36,7 +39,8 @@
3639
},
3740
"autoload-dev": {
3841
"psr-4": {
39-
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/"
42+
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/",
43+
"Elasticsearch\\IntegrationTests\\": "tests/Elasticsearch/IntegrationTests/"
4044
}
4145
},
4246
"config": {
@@ -48,8 +52,7 @@
4852
"phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4 -sp tests"
4953
],
5054
"phpstan": [
51-
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-src.neon src --level 2 --no-progress",
52-
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-tests.neon tests --level 7 --no-progress"
55+
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-src.neon src --level 2 --no-progress"
5356
]
5457
}
5558
}

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
beStrictAboutOutputDuringTests="true"
1010
>
1111
<php>
12-
<server name="ES_TEST_HOST" value="http://localhost:9200"/>
12+
<env name="ES_TEST_HOST" value=""/>
1313
</php>
1414
<testsuites>
1515
<testsuite name="Tests">

0 commit comments

Comments
 (0)