-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
travis: optimize to run coverage only once #1251
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-3495 We use Jira to track the state of pull requests and the versions they got |
- composer install --prefer-source --dev | ||
|
||
script: | ||
- ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover.xml | ||
- ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover-slc.xml --exclude-group performance,non-cacheable,locking_functional | ||
- if [ $TRAVIS_PHP_VERSION == 'hhvm']; then ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover.xml; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we apply coverage only to 5.6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, gotta go now. Will fix later. Also found a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of duplicating the whole command, I would rather export an environment variable PHPUNIT_FLAGS
(empty string or --coverage-clover ./build/logs/clover.xml
depending of the PHP version) during the before_script and then using it when running the command. this would avoid having to keep methods in sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof Neat idea, thanks. I'll try to implement it.
All looks fine now. I've narrowed coverage to PHP 5.6 and sqlite, as it seems the fastest combination. Could re-check please? |
Great work @TomasVotruba 👍 |
Very good! Merging! |
travis: optimize to run coverage only once
Thank you and thanks @stof for nice idea. |
- if [ $DB = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests_tmp;' -U postgres; fi | ||
- if [ $DB = 'pgsql' ]; then psql -c 'create database doctrine_tests;' -U postgres; fi | ||
- if [ $DB = 'pgsql' ]; then psql -c 'create database doctrine_tests_tmp;' -U postgres; fi | ||
- if [ $DB = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS doctrine_tests_tmp;create database IF NOT EXISTS doctrine_tests;'; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These DB related CREATE/DROP commands can potentially be eliminated, too like in DBAL: doctrine/dbal@a660106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I send PR? If so, to all 2.5-2.1 branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just master
is fine
Ref: Ocramius/Instantiator#17
Before: ~3,5 hours
Now: ~52 min
So what do you think?