Skip to content

Commit

Permalink
Tests and Travis
Browse files Browse the repository at this point in the history
- Fix services in neon
- Added some tests
- Set up tests environment
- Travis update
  • Loading branch information
Spamercz committed Apr 7, 2019
1 parent 9fbde74 commit c8a2ed5
Show file tree
Hide file tree
Showing 112 changed files with 4,852 additions and 1,537 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
composer.lock
48 changes: 41 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
language: php

cache:
directories:
- $HOME/.composer/cache
- $HOME/phpcs-cache

php:
- 7.1
- 7.2
- 7.1
- 7.2
- 7.3

services:
- elasticsearch

env:
matrix:
- RUN_TESTS=1 COMPOSER_EXTRA_ARGS=""
- RUN_TESTS=1 COMPOSER_EXTRA_ARGS="--prefer-lowest"

before_script:
- composer self-update
- composer install --no-interaction --prefer-dist
matrix:
fast_finish: true
include:
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" COVERAGE="--coverage ./coverage.xml --coverage-src ./src"
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" PHPSTAN=1 RUN_TESTS=0
- php: 7.3
env: COMPOSER_EXTRA_ARGS="" CODING_STANDARD=1 RUN_TESTS=0

before_install:
- travis_retry composer self-update

install:
- travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist --prefer-stable $COMPOSER_EXTRA_ARGS # update because we may need --prefer-lowest option

script:
- vendor/bin/phpstan analyse -l 7 -c phpstan.neon src tests
- vendor/bin/phpcs --standard=vendor/spameri/coding-standard/src/ruleset.xml src tests
- if [ "$PHPSTAN" = "1" ]; then vendor/bin/phpstan analyse -l 7 -c phpstan.neon src tests; fi
- if [ "$CODING_STANDARD" = "1" ]; then vendor/bin/phpcs --standard=vendor/spameri/coding-standard/src/ruleset.xml --cache=$HOME/phpcs-cache/.phpcs-cache src tests; fi
- if [ "$RUN_TESTS" = "1" ]; then vendor/bin/tester $COVERAGE -s -c ./tests/php.ini-unix ./tests; fi

after_script:
- if [ "$COVERAGE" != "" ]; then vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml || true; fi

after_failure:
- 'for i in $(find ./tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done'
73 changes: 41 additions & 32 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
{
"name": "spameri/elastic",
"type": "library",
"description": "ElasticSearch for Nette Framework",
"keywords": [
"nette",
"spameri",
"elastic",
"elasticsearch"
],
"homepage": "http://github.com/spameri",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"support": {
"issues": "https://github.com/spameri/elastic/issues"
},
"type": "library",
"description": "ElasticSearch for Nette Framework",
"keywords": [
"nette",
"spameri",
"elastic",
"elasticsearch"
],
"homepage": "http://github.com/spameri",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"support": {
"issues": "https://github.com/spameri/elastic/issues"
},
"authors": [
{
"name": "VBoss",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1",
"nette/di": "^2.4.10",
"nette/security": "^2.4.3",
"spameri/elastic-query": "^0.3.0",
"elasticsearch/elasticsearch": "^6.0",
"kdyby/console": "^2.7.1",
"kdyby/datetime-provider": "v1.0.0",
"kdyby/monolog": "^1.3.2",
"tracy/tracy": "^2.5.3"
},
"require-dev": {
"spameri/coding-standard": "dev-master",
"nette/tester": "^2.2.0",
"phpstan/phpstan-shim": "^0.11.5",
"php-coveralls/php-coveralls": "^2.1",
"nette/bootstrap": "2.4",
"nette/http": "^2.4",
"mockery/mockery": "^1.2"
},
"autoload": {
"psr-4": {
"Spameri\\Elastic\\": "src/"
}
},
"require": {
"php": ">=7.1",
"nette/di": "v2.4.14",
"nette/security": "v2.4.3",
"spameri/elastic-query": "v0.3.0",
"elasticsearch/elasticsearch": "^6.0",
"kdyby/console": "v2.7.1",
"kdyby/datetime-provider": "v1.0.0",
"kdyby/monolog": "v1.3.2",
"tracy/tracy": "v2.5.3"
},
"require-dev": {
"nette/tester": "2.1.0",
"phpstan/phpstan-shim": "0.11.2",
"spameri/coding-standard": "dev-master"
"autoload-dev": {
"psr-4": {
"SpameriTests\\": "tests/SpameriTests"
}
}
}
Loading

0 comments on commit c8a2ed5

Please sign in to comment.