WordPress.org

Make WordPress Core

Opened 2 years ago

#41781 new enhancement

do not forcefully phpunit delete fixtures data

Reported by: drzraf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.1
Component: Build/Test Tools Keywords:
Focuses: performance Cc:
PR Number:

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 (0)

Note: See TracTickets for help on using tickets.