Skip to content

Commit

Permalink
Adding benchmark to CI (#174)
Browse files Browse the repository at this point in the history
Adding benchmark to CI
  • Loading branch information
moufmouf committed Sep 9, 2019
1 parent 63c78c0 commit b52199b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ cache:
matrix:
include:
- php: 7.2
env: PREFER_LOWEST="" DB=mysql RUN_PHPSTAN=1 RUN_CSCHECK=1 RUN_REQUIRECHECKER=1
env: PREFER_LOWEST="" DB=mysql RUN_PHPSTAN=1 RUN_CSCHECK=1 RUN_REQUIRECHECKER=1 RUN_PERF_TEST=1
services:
- mysql
- php: 7.3
Expand Down Expand Up @@ -98,6 +98,21 @@ script:
if [ "$RUN_REQUIRECHECKER" == "1" ] ; then
composer require-checker
fi
- |
if [ "$RUN_PERF_TEST" == "1" ] ; then
echo "***** Running PHPBENCH on current branch *****" && \
./phpbench.dist.sh run --tag=current_pr --store
fi
after_success:
- |
if [ "$RUN_PERF_TEST" == "1" ] && [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ] ; then
git fetch --unshallow && \
git checkout master && \
composer update && \
echo "***** Running PHPBENCH on master branch for comparison *****" && \
./phpbench.dist.sh run --tag=master --store && \
./phpbench.dist.sh report --uuid=tag:current_pr --uuid=tag:master --report='{extends: compare, compare: tag}'
fi
after_script:
- if [ "$COVERALLS" = "true" ] ; then ./vendor/bin/php-coveralls -v; fi
- if [ "$COVERALLS" = "true" ] ; then vendor/bin/couscous travis-auto-deploy --php-version=7.1 -vvv; fi
2 changes: 1 addition & 1 deletion phpbench.dist.sh
Expand Up @@ -8,4 +8,4 @@ export DB_USERNAME=root
export DB_PASSWORD=
export DB_NAME=tdbm_benchmark

vendor/bin/phpbench
vendor/bin/phpbench "$@"
2 changes: 1 addition & 1 deletion tests/Performance/ManyToOneBench.php
Expand Up @@ -120,7 +120,7 @@ private static function recursiveDelete(string $str): bool
return false;
}

private function getConnection(): Connection
private static function getConnection(): Connection
{
return ConnectionFactory::createConnection(
getenv('DB_DRIVER') ?: null,
Expand Down

0 comments on commit b52199b

Please sign in to comment.