CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • Easy to run tests.
Pages: [1]

Author Topic: Easy to run tests.  (Read 998 times)

Peter Haight

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
Easy to run tests.
September 21, 2013, 06:51:38 pm
I think the main thing in getting developers to write more tests is to make them painless as possible. Right now I think it is really hard to write tests for CiviCRM. The first hard thing is just getting the tests to run. To that end, I've done some work to try to make a script you can run that downloads and sets everything up for you and then runs the tests.

I've stuck this version in a fork I've got up on github, and if other people could try it out and send me problems, I'll work on getting them fixed so we can have a very easy to run test suite.

To run the tests you need to do:
git pull https://github.com/giant-rabbit/civicrm-core
cd civicrm-core
./tests/run.php

Let me know how it goes.

Peter Haight

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
Re: Easy to run tests.
September 21, 2013, 07:37:42 pm
One thing this new script does is sets up a mysql server to run on a RAM disk instead of a regular disk in order to speed up the tests. One other nice thing about this is that it actually runs a separate mysqld process, so it can just setup the root account and password for you which means you don't have to do any database setup. To try out that way, just do:

./tests/run.php -m

It will create a 500MB ram disk in a directory called 'tmpfs' in the civicrm-core directory. It runs 'sudo' to do this, so you will need to type your sudo password. To clean up the ramdisk when you are done, just do:

./tests/run.php -c


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • Easy to run tests.

This forum was archived on 2017-11-26.