paulgibbs / behat-wordpress-extension

WordHat: Behat for WordPress
https://wordhat.info
GNU General Public License v3.0
106 stars 20 forks source link

Make WP-CLI driver commands async #248

Open paulgibbs opened 5 years ago

paulgibbs commented 5 years ago

Expected behaviour

With the WP-CLI driver, that I can create a post and enrich it with metadata, and that it is quickly actioned by WP-CLI.

Current behaviour

With the WP-CLI driver, if I create a post, assign several taxonomies, some post meta, etc, then WordHat will shell out to execute the WP-CLI commands one-by-one in a blocking fashion.

Context

A project with a custom post type (and custom step definition) with various taxonomy and meta requirements, over WP-CLI-over-SSH on a crappy VM, is too slow.

It would be nice if we can try to perform WP-CLI commands async. This won't be desired for many commands, but for things that maybe don't require a value to be returned (i.e. creating post meta, or a taxonomy assignment). It may also be an opt-in/opt-out behaviour at a lower level rather than something we can implement for the bundled step definitions.