When installing, Drupal adds in stored procedures to some databases, often this is to create consistency between databases. However when the testbeds are cleaned, only the tables are cleared, other bits'n pieces are still lingering around in the database. While drupal is robust enough to handle this, it does worry me that the next patch is using a tainted environment. The problems surrounding this are:

  • using db_prefix, if the testbed's stored procedure definitions are different to the D7 definitions then installing D7 HEAD and testing a patch will override the testbeds procedures. This has potential to corrupt the testing result.
  • someone may add a procedure in a patch that then doesn't get removed, this may result in false testing results there after.

The solution I see is to put the test on seperate schemas/databases. For postgres that means: run tests on a seperate schema, from memory, Drupal 7 support schema support i.e schema.table and mysql suport database.table syntax. That should make it as easy as

#PostgreSQL
DROP SCHEMA slave CASCADE;
CREATE SCHEMA slave;

#MySQL
DROP DATABASE slave;
CREATE DATABASE slave;

That will also mean for MySQL, that the testbed database user needs the ability to create and drop databases. I'd suggest to different users for MySQL, on for the slave and one for the test itself.

Comments

boombatower’s picture

Assigned: Unassigned » boombatower

Currently testing takes place in a separate database. I'll work up a patch shortly.

boombatower’s picture

Status: Active » Needs review
StatusFileSize
new4.06 KB
boombatower’s picture

Title: Testbed databases don't clean properly » Create/Drop databases to ensure cllean start
Category: bug » task
Status: Needs review » Fixed

Committed.

boombatower’s picture

StatusFileSize
new982 bytes

Followup committed, to add delimiters for PostgreSQL.

boombatower’s picture

StatusFileSize
new986 bytes
josh waihi’s picture

sweet

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.