Skip to content
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

Merged
merged 1 commit into from
Jan 15, 2015
Merged

travis: optimize to run coverage only once #1251

merged 1 commit into from
Jan 15, 2015

Conversation

TomasVotruba
Copy link
Contributor

Ref: Ocramius/Instantiator#17

Before: ~3,5 hours
Now: ~52 min

So what do you think?

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DDC-3495

We use Jira to track the state of pull requests and the versions they got
included in.

@TomasVotruba TomasVotruba changed the title [WIP] travis: optimize to run coverage only once travis: optimize to run coverage only once Jan 14, 2015
- 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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

@TomasVotruba
Copy link
Contributor Author

All looks fine now. I've narrowed coverage to PHP 5.6 and sqlite, as it seems the fastest combination.

Could re-check please?

@fprochazka
Copy link
Contributor

Great work @TomasVotruba 👍

@Ocramius
Copy link
Member

Very good! Merging!

@Ocramius Ocramius self-assigned this Jan 15, 2015
Ocramius added a commit that referenced this pull request Jan 15, 2015
travis: optimize to run coverage only once
@Ocramius Ocramius merged commit 934e4fd into doctrine:master Jan 15, 2015
@TomasVotruba
Copy link
Contributor Author

Thank you and thanks @stof for nice idea.

@TomasVotruba TomasVotruba deleted the travis-optimize branch January 15, 2015 00:33
- 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
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just master is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants