Make WordPress Core

Opened 7 years ago

Last modified 8 weeks ago

#41781 new enhancement

do not forcefully phpunit delete fixtures data

Reported by: drzraf's profile drzraf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.1
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

When phpunit runs, there are at least three places where test-data are removed (see below).

Fixture deletion is good in its principle. But it's also sometimes painful, especially when one is in the process of developing tests and need to run the testsuite many times.

WP (re)installation + shared XML fixture loading could easily be very slow (especially given XML importer slowness).
If your plugin's testsuite does not even contains destructive operations (or controlled destructions) then all that time spent in testsuite (re)installation is very frustrating. (In my case it's 1 minutes 50 versus 2 seconds)

It would be good if developers could control whether or not fixtures are deleted & database cleaned, when phpunit starts/finishes.

Places that need change:

There is also: _delete_all_data() inside tearDownAfterClass() but this one can be easily overriden.

Could a couple of filter/action/define/whatever could be made so that data cleanup, being the default, could be disabled if developer wants to?
thx

Change History (1)

#1 @pbearne
8 weeks ago

  • Focuses performance removed

As we move to the new PHPUnit version and test updates, this should be part of that not in performance

Note: See TracTickets for help on using tickets.