Needs review
Project:
SimpleTest
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2010 at 23:18 UTC
Updated:
31 Jan 2017 at 19:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
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 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 commentedHere is patch to fix the issue.
Comment #4
daniel.nitsche commentedThanks for the patch -- I can confirm this fixes the issue.
Comment #5
al.ex commentedconfirming issue & fix
Comment #6
ygerasimov commentedComment #7
neochief commentedReroll agains current 2.x.
Comment #8
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 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 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.