3

I have a PR that adds a file CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl. How should I go about testing this code?

  • Note that the more common case is to be inserting upgarde code into a file like this. In both cases the important thing is to test the upgrade code works properly. JMA has found that it is useful to test db upgrade code against a variety of dbs that have been found in the wild, as well as the tests that automatically check upgrades on the default db. – Joe Murray Apr 7 '15 at 2:09
10

If you have installed civicrm-buildkit and configured civibuild, then you can use the tutorial steps at Daily Coding: Upgrade Tests.

If you don't use civibuild, then you can piece-together a similar workflow using civicrm-upgrade-test.

For more discussion about writing upgrade logic, see Upgrade Reference on the wiki.

For a general, high-level overview of automated tests (including upgrade tests), see Testing on the wiki.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.