Page MenuHomePhabricator

Continuous integration - CiviCRM
Closed, ResolvedPublic0 Estimated Story Points


CiviCRM recently did some work for us to help build a better testing infrastructure within Civi. We're confident this can speed up development and make our changes more robust, and just need to finish the work out.

This is blocking many Q3 projects, since we want the testing to help us do a CiviCRM release upgrade safely.


  • PHPUnit tests available for every input queue pipeline, using bundled test fixture data.
  • Manually process any message type from drush, using a test fixture or other file
  • Do not connect to the queue server.
  • Do not require Drush or Simpletest, tests can be run by phpunit directly.

It would be a huge bonus if we could do without MySQL. The blocker here is that Civi does not support any other SQL syntax.


A phpunit.xml configuration file in the project's root directory will specify a bootstrap file in sites/default, which defines the DRUPAL_ROOT directory and makes the base wmf_common PHPUnit test case class available. Drupal bootstrapping is done with minimal code, without dependencies on Drush or Simpletest.

Self-contained unit tests may inherit PHPUnit_Framework_TestCase, but tests that need Drupal or database functionality should inherit from BaseWmfDrupalPhpUnitTestCase.

Drush single-message processing can be done using the new commands dpm, rpm, and rfdpm. The command will take a single argument, the path to a json file containing the message contents. See example messages in queue2civicrm/tests/data.


  • cmdline option to drush jobs to synthesize or specify a new gateway_txn_id, to override the fixture data and prevent duplicate errors. We could eventually use this sort of instrumentation to trickle test transactions through our system and continually test it.
  • I've probably trashed the existing SimpleTest-based cases. Refactor them to run under PHPUnit.

Related Objects

Event Timeline

atgo raised the priority of this task from to Needs Triage.
atgo updated the task description. (Show Details)
atgo added a project: Fundraising-Backlog.
atgo changed Security from none to None.
atgo added a subscriber: atgo.
atgo updated the task description. (Show Details)Dec 11 2014, 11:45 PM
atgo triaged this task as Medium priority.Jan 9 2015, 8:57 PM
awight added a subscriber: awight.Jan 9 2015, 10:44 PM
awight updated the task description. (Show Details)Jan 9 2015, 10:51 PM
awight added subscribers: hashar, greg.
atgo edited a custom field.
Ejegg added a subscriber: Ejegg.Feb 25 2015, 6:23 PM
Cmcmahon raised the priority of this task from Medium to High.Feb 25 2015, 6:38 PM

Change 194915 had a related patch set uploaded (by Awight):
Move integration scripts into this repo

Change 194915 merged by Ejegg:
Move integration scripts into this repo

Change 194998 had a related patch set uploaded (by Awight):
WIP download stuff before running it

Change 195010 had a related patch set uploaded (by Awight):
Don't pushd to crazy directory to run drush

Change 195011 had a related patch set uploaded (by Awight):
Ignore vendor

Change 195010 merged by Ejegg:
pushd to less crazy directory before running drush

Change 195011 merged by Ejegg:
Ignore vendor

Change 194998 merged by Ejegg:
Download stuff before running it.

awight closed this task as Resolved.Jun 23 2015, 1:04 AM
awight claimed this task.
awight moved this task from AWight brooding on to Backlog on the Fundraising-Backlog-Old board.