I appear to have a corrupted behat installation. The problems began when I upgraded moodle and went to re-initialise behat. I inadvertently did this as root and got the output
You are running composer as "root", while "/home/rjl83/.composer" is owned by "rjl83" You are already using composer version 1.9.1 (stable channel). Do not run Composer as root/super user! See https://getcomposer.org/root for details
Seeing that message (somewhat belatedly), I hit CTRL/C (I'm on Unix) which killed the initialisation. Unfortunately behat was by now halfway through dropping all the tables.
Now, just about anything I do with behat results in the output
Generating autoload files !!! Table "context" does not exist !!! Debug info: Error code: ddltablenotexist Stack trace: * line 665 of /lib/dml/moodle_database.php: dml_exception thrown * line 1537 of /lib/dml/moodle_database.php: call to moodle_database->where_clause() * line 6167 of /lib/accesslib.php: call to moodle_database->get_record() * line 747 of /lib/setup.php: call to context_system::instance() * line 119 of /admin/tool/behat/cli/util_single_run.php: call to require()
Does anyone know if there's a way to get completely reinitialise the behat environment? I could write a script to delete all the "b_" tables but I suspect that that wouldn't solve the problem anyway.