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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How many ways to skin a testing cat?
Pages: [1]

Author Topic: How many ways to skin a testing cat?  (Read 854 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
How many ways to skin a testing cat?
December 15, 2011, 01:34:12 pm
Hi,

So we can
1) set up CIVICRM_DSN in civicrm.settings.php
2) as of today 4.1 set an ENV variable CIVICRM_TEST_DSN
these two options (and more info about how to configure) work with
php tests/bin/api.php & run.php

3) set params to tools/scripts/phpunit -utest -ptest db_host api_v3_AllTests

or

4) set them in .my.cfg

and

5) (in the code but never got it working) setting ENV USER and PASS


Do we really need to keep them all? If yes, in which order? (I'd suggest 1->5 by priority, ie. if you set the CIVICRM_DSN it will never try to read it from my.cfg

Ok for that order? If yes, I will modify the civicrm.settings so it works that way. as it doesn't need any other configuration anymore than the mysql and that it can be done without touching civicrm.settings, I'd suggest to move the civicrm.settings.php.txt to  civicrm.settings.php so it's one less step to get a running test, and allows to have
tests/bin/run.php that guides you through config


I personally have a security concern and really don't like needing to give my root account (or similar) to a test program that can potentially wipe clean all databases in my server (please respond to my thread about why SUPER is needed)

... and I don't think 3 or 4 should be promoted, as I don't see the benefits over 1 & 2 (assuming we can get rid of the SUPER need) and I don't like something else than $mysql or $mysqladmin using the configuration in .my.cfg  that should only be for admin tasks, but for the sake of compatibility, I don't mind letting whoever wants run whatever program with that config on their computers.

Plan B: we keep the two options separated and if you want 3-5 you copy settings.civicrm.php.txt  and if you want 1-2 you copy .api (that's a crappy solution IMO, but that will close the issue)

Ok, Got a lot to finish and on the plane tomorrow. will catch up tomorrow am and commit whatever you want
« Last Edit: December 15, 2011, 01:38:37 pm by xavier »
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: How many ways to skin a testing cat?
December 15, 2011, 03:01:18 pm
Hi,

I wrote my own wrapper for the tests long ago but this is actually better because it was a bit of a pain switching between trunk & 4.1 & 4.0 using mine (which I often do).

Now I don't need to worry about the COMPILE path which I had to configure per version & editing civicrm.settings.php per branch / per trunk & when I change my file structure around nothing breaks - Great stuff.

I vote to rename the civicrm.settings.php.txt to civicrm.settings.php

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How many ways to skin a testing cat?

This forum was archived on 2017-11-26.