Trying out the
Thanks to a pointer by @schlessera in the WordPress #cli slack channel, there’s the
wp-cli/wp-cli-dev package that attempts to make it easier to download and scaffold out a full wpcli dev environment.
It wasn’t a seamless path since it seems like Github was throttling me, or in some way rejecting my key. To solve it, I temporarily commented out a call to refresh the various repos right after cloning them. This allowed the
composer install command to finish cleanly and put all the various repos into place.
I use Local. How do I run Behat?
Here’s that specific error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
This basically means that MySQL is having issues connecting to the default socket. But since I use Local to quickly create environments instead of directly installing things like MySQL — what do I need to do?
The general flow was to:
- Find the configuration file for he running MySQL process.
- Search that config file for the
- Export the
- Run the tests!
For me, under a Local site’s environment, that process looks something like this:
ps aux | grep mysql grep 'socket' ~/Library/Application\ Support/Local/run/o5ykeOZFY/conf/mysql/my.cnf export WP_CLI_TEST_DBHOST='localhost:/Users/ben.turner/Library/Application Support/Local/run/o5ykeOZFY/mysql/mysqld.sock' composer run behat