I'm not sure how does it happened, but after running simpletests couple of times, my tables in Drupal installation were removed somehow.
Now I've the errors like:
Warning: Table 'drupal.access' doesn't exist query
Warning: Table 'drupal.users' doesn't exist
I've checked and the tables aren't there.
The only possible code which could do that, is probably this one (file: drupal_web_test_case.php):
// Remove all prefixed tables (all the tables in the schema).
$schema = drupal_get_schema(NULL, TRUE);
$ret = array();
foreach ($schema as $name => $table) {
db_drop_table($ret, $name);
}
I can't see here any conditions like preg_match('/simpletest\d+.*/',
as I've seen in the .module file.
I've to recover my db, which takes more than 1h, and I'll do some other testing why this happened.
This could be related to option 'dependencies' in getInfo() which I was testing instead of enabling modules in setUp().
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal_web_test_case.php-1781018.patch | 699 bytes | kenorb |
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedI've checked and the function
$schema = drupal_get_schema(NULL, TRUE);
is actually returning the real table list, so I don't understand what this code exactly trying to do and why it's dropping the tables from the real instance (tearDown method).It suppose to delete the tables only created by setUp().
Comment #2
kenorb CreditAttribution: kenorb commentedI've checked few times more, definitely it's a Simpletest bug in the code mentioned above.
SQL queries executed:
Basically all of them.
Some data from xdebug:
It happens only when I'm using 'dependencies' key in getInfo()
E.g.:
Write any test function, it happens at the end of cleaning the environment.
Comment #3
kenorb CreditAttribution: kenorb commentedThe patch fixes the problem.
Comment #3.0
kenorb CreditAttribution: kenorb commentedupdated
Comment #6
kenorb CreditAttribution: kenorb commentedComment #7
LendudeThis version is not supported anymore.