Version 5 (modified by 10 years ago) ( diff ) | ,
---|
CiviCRM HowTo Run Tests
Summary and expansion of the procedure outlined in the CiviCRM page Settings up your personal testing sandbox.
Gitify a project
The tests and test tools are not in the release package of CiviCRM, so you have to gitify the code - that is, convert it into a git repository and get the latest version of the code from Git Hub.
I have had a couple of problems with this:
- The
gitify
script gives you no options but to use the Master branch. - The
gitify
script gives you an example that does not work. - Still, some of the tests fail.
Nevertheless, the procedure to do this is:
sudo apt-get install git
(if it is not already installed)wget https://github.com/civicrm/civicrm-core/raw/master/bin/gitify
bash gitify git://github.com/civicrm <path to civicrm> --hooks
. e.g.bash gitify git://github.com/civicrm /var/www/sites/all/modules/civicrm/ --hooks
Set up test database
- Create DB
civicrm_tests_dev
- Create the test user with SUPER privileges.
- cd /path-to/civicrm
- mysql -u user -p -hhostname civicrm_tests_dev < sql/civicrm.mysql
- mysql -u user -p -hhostname civicrm_tests_dev < sql/civicrm_generated.mysql
- In the file
<path to civicrm>/tests/phpunit/CiviTest/civicrm.settings.local.php
add the linedefine('CIVICRM_DSN', 'mysql://db_username:db_password@localhost/civicrm_tests_dev');
Note:
See TracWiki
for help on using the wiki.