wp-cli / wp-cli-dev

🛠 WP-CLI development environment that allows for easy development across all packages
36 stars 36 forks source link

Prefetch `WP_VERSION=latest` when running `composer install` #58

Open danielbachhuber opened 10 months ago

danielbachhuber commented 10 months ago

On hack days with a slow internet connection, the initial run of composer behat can be quite slow as WP-CLI fetches a copy of WordPress across the network. This can cause the user to think something is broken with their test suite.

Let's instead download WP_VERSION=latest during composer install and put it in the appropriate cache directory. This will provide more visibility into what's going on.

schlessera commented 10 months ago

@danielbachhuber That will make the Composer run seem unnecessarily slow, and there might be scenarios where people need to run composer install but have no use for the Behat tests.

How about instead just providing meaningful progression feedback while Behat is downloading WP?

danielbachhuber commented 10 months ago

@schlessera Or a third option: a composer cache-wordpress or similar command that a user can run during the setup process.

schlessera commented 10 months ago

@danielbachhuber I'm not sure how this third option would solve the actual issue, it just seems to add complexity, isn't it?

danielbachhuber commented 10 months ago

@schlessera The actual issue is that the downloading of WordPress is an opaque part of the setup process. The third option solves it by making it an explicit (albeit not required) step.

I don't feel strongly about it, though. More verbosity works for me too.

schlessera commented 10 months ago

@danielbachhuber I think the current timing and behavior is already correct (only downloading when needed, caching as possible, not requiring the user to know about the details). But, definitely, it needs more feedback. What could work is to prepend it onto composer behat instead, that would not change the behavior or the requirements, but allows for adding the feedback without messing with the Behat STDOUT/STDERR.