Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In #666956: Provide DrupalCloneTestCase for testing pre-configured drupal sites a patch was committed to simpletest 7.x-2.x to allow testing of pre-configured drupal sites. DrupalCloneTestCase is not functional and throws this error:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd7pow.simpletest737772system' doesn't exist: SELECT * FROM {system} WHERE type = 'theme' OR (type = 'module' AND status = 1) ORDER BY weight ASC, name ASC; Array ( ) in system_list() (line 151 of includes/module.inc).
Comment | File | Size | Author |
---|---|---|---|
#10 | 983266-10-simletest-clone.patch | 2.02 KB | minorOffense |
| |||
#7 | simpletest-clone-fix-983266.patch | 1.83 KB | neochief |
#3 | 0001-Issue-983266-by-ygerasimov-Fix-for-DrupalCloneTestCa.patch | 2.15 KB | ygerasimov |
#1 | 983266_1_DrupalCloneTestCase.patch | 1019 bytes | scor |
Comments
Comment #1
scor CreditAttribution: scor commentedI'm attaching a patch to reproduce this bug. You should get the error above if you attempt to run the "SimpleTest DrupalCloneTestCase" test. Note that testContact() should fail unless you have enable the contact module, but the PDOException is thrown way before SimpleTest gets to run the tests properly anyways.
Comment #2
daniel.nitsche CreditAttribution: daniel.nitsche commentedI can confirm this is still an issue -- is there a planned fix in the works?
Having a quick look at the code, does the setUp function need to be overwritten from the parent DrupalWebTestCase? (because DrupalWebTestCase is design to rebuild the DB from scratch)
In Drupal 6 I was using this technique to run tests on the live DB
http://www.trellon.com/content/blog/forcing-simpletest-use-live-database
but it doesn't seem to work for Drupal 7 (which is why I was looking at DrupalCloneTestCase).
Comment #3
ygerasimov CreditAttribution: ygerasimov commentedHere is patch to fix the issue.
Comment #4
daniel.nitsche CreditAttribution: daniel.nitsche commentedThanks for the patch -- I can confirm this fixes the issue.
Comment #5
al.ex CreditAttribution: al.ex commentedconfirming issue & fix
Comment #6
ygerasimov CreditAttribution: ygerasimov commentedComment #7
neochief CreditAttribution: neochief commentedReroll agains current 2.x.
Comment #8
daniel.nitsche CreditAttribution: daniel.nitsche commentedThis patch doesn't work for me against 2.x. I get 3 errors (I assume the last error listed is the main problem). I'll see if I can work out what's going on.
PS. anyone know if this module is still alive? There hasn't been a commit in over a year.
Additional uncaught exception thrown while handling exception.OriginalPDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO simpletest110720node SELECT * FROM node; Array ( ) in DrupalCloneTestCase->cloneTable() (line 3488 of /var/www/test/sites/all/modules/simpletest/drupal_web_test_case.php).
AdditionalPDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.simpletest110720node_type' doesn't exist: SELECT nt.* FROM {node_type} nt WHERE (disabled = :db_condition_placeholder_0) ORDER BY nt.type ASC; Array ( [:db_condition_placeholder_0] => 0 ) in _node_types_build() (line 704 of /var/www/test/modules/node/node.module).
Uncaught exception thrown in session handler.PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.simpletest110720sessions' doesn't exist: SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => rzQqzYV7zduqr2bBqabKt8q46RGhhbMw7mKEf92eDnI [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /var/www/test/includes/session.inc).
Comment #9
GaëlGSometimes when database updates have been done, the order of columns in the database is not the same as the one in the schema.
To have it work, I had to change:
into:
Comment #10
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedHere's an updated patch that applies to the sept 2016 dev release. I can confirm this actually does let the module clone the db properly.
Comment #12
minorOffense CreditAttribution: minorOffense at Coldfront Labs Inc. commentedI'm gonna put it back to needs review. Looks like the CI runner failed to load some composer stuff. Not related to the patch itself.