Make WordPress Core

Opened 10 months ago

Last modified 8 months ago

#50412 new enhancement

Add support for common PHPUnit arguments when watching

Reported by: iandunn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:


r42760 added the watch:phpunit task, but it only supports the filtering tests by the group. In ticket:42282#comment:18 @soulseekah asked about adding support PHPUnit filters, etc.

That seems very desirable, and there are other PHPUnit arguments that would be useful too, like filtering by test name, and file.

Rather than building all that from scratch, though, we could switch to using phpunit-watcher instead. It already has support for all of those, plus an interactive mode where you can switch between them at will, rather than having to restart the task with different args.

I've been using it lately and it seems to work well1.

@netweb, it looks like you've contributed to it in the past; do you think it'd work well for Core?

[1] Since Core is such a large repo, we'd probably need to wait until #116-phpunit-watcher is merged.

Change History (3)

#1 @iandunn
10 months ago

If #33-phpunit-watcher is implemented, that might give us the ability to have an interactive command that toggles the WP_TESTS_SKIP_INSTALL variable from #43432, which would be another great devex improvement.

#2 @netweb
10 months ago

No objections @iandunn, phpunit-watcher is like Jest for PHPUnit, so I'm fully behind that 💯

Also, this may be of interest Ian, https://pestphp.com/ it's Jest for PHPUnit, alas the _watcher_ is not up to scratch yet, but it a project I'll be following development of

Note: See TracTickets for help on using tickets.