[wp-trac] [WordPress Trac] #25871: Always Clean Install in PHPUnit Tests

WordPress Trac noreply at wordpress.org
Thu Nov 7 20:36:24 UTC 2013


#25871: Always Clean Install in PHPUnit Tests
-------------------------+-----------------------------
 Reporter:  bpetty       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Unit Tests   |    Version:
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 The unit tests only re-install WordPress from a previous run if using a
 different config (multisite vs single), it requires a DB upgrade (checking
 db_version), or `wp-tests-config.php` changes in any way (hashed). This
 was originally introduced from @nbachiyski with the [https://github.com/nb
 /wordpress-tests/commit/d3de3aeee26196a268abb0e3a278b6b51bc5e946 test
 runner rewrite], and modified again by @gcorne to [https://github.com/nb
 /wordpress-tests/commit/0db11272b36ce62ade4f920ed4f9ca87efa2a971 account
 for wp-tests-config.php].

 The problem with doing this lies in these areas though:

 - In transitioning these unit tests to run against the `build` version
 instead of `src` (and we do want to do this soon after this change), we
 should never leave extra files like `.wp-tests-version` in the `build`
 directory that could be accidentally packaged with WP even if it was
 ignored in SVN.
 - We should '''always''' assume failure from previous unit test runs, and
 '''always''' build and test from a clean install. It doesn't matter if
 it's the same `db_version` and install type, anything could have gone
 wrong and leave us with incorrect testing results affected by previous
 runs.
 - Most of the time, this is actually ineffective because testers should
 already be running both the single site, and multisite tests one after the
 other, causing a re-install with the current code anyway.

 Besides the above though, re-installing WordPress takes less than a second
 compared with the 3 to 5 minutes the actual tests take anyway. It's not
 slowing down the tests any.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25871>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list