I've installed 1.2, deleted 1.2 folder, extracted 2.5, executed update.php and get the following:

    * user warning: Table 'drupal6.simpletest' doesn't exist query: DELETE FROM simpletest in C:\Inetpub\wwwroot\drupal6\sites\all\modules\simpletest\simpletest.install on line 256.
    * user warning: Unknown table 'simpletest_test_id' query: DROP TABLE simpletest_test_id in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 261.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: DELETE FROM simpletest in C:\Inetpub\wwwroot\drupal6\sites\all\modules\simpletest\simpletest.install on line 278.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: ALTER TABLE simpletest DROP message in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 322.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: ALTER TABLE simpletest ADD `message` TEXT DEFAULT NULL in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 298.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: ALTER TABLE simpletest CHANGE message `message` TEXT NOT NULL in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 520.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: DELETE FROM simpletest in C:\Inetpub\wwwroot\drupal6\sites\all\modules\simpletest\simpletest.install on line 301.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: ALTER TABLE simpletest DROP caller in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 322.
    * user warning: Table 'drupal6.simpletest' doesn't exist query: ALTER TABLE simpletest ADD `function` VARCHAR(255) NOT NULL DEFAULT '' in C:\Inetpub\wwwroot\drupal6\includes\database.mysql-common.inc on line 298.

Comments

hass’s picture

Same again. I have installed 2.5 than checked the status page that shows me there are database upgrades (why ever - this shouldn't be the case, too). Executing this upgrades end with the following:

The following queries were executed
simpletest module
Update #6000

    * Failed: DROP TABLE {simpletest_test_id}
    * CREATE TABLE {simpletest_test_id} ( `test_id` INT NOT NULL auto_increment, PRIMARY KEY (test_id) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Update #6001

    * Failed: ALTER TABLE {simpletest} DROP message
    * Failed: ALTER TABLE {simpletest} ADD `message` TEXT DEFAULT NULL
    * Failed: ALTER TABLE {simpletest} CHANGE message `message` TEXT NOT NULL

Update #6002

    * Failed: ALTER TABLE {simpletest} DROP caller
    * Failed: ALTER TABLE {simpletest} ADD `function` VARCHAR(255) NOT NULL DEFAULT ''
boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

There is no upgrade path from 1.x to 2.x That was an update from a previous 2.x version. Please remove the SimpleTest row from the system table and try installing the module.

hass’s picture

I tried this now... and the schema is now created correctly, but nevertheless simpletest doesn't work.

Aside - do you really think that hacking the system table is user friendly? You should spend some resonable time on an upgrade path!

boombatower’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Well the issue was that SimpleTest 1.x has no data in database....so nothing to upgrade. Somewhat of an issue with Drupal since you can't uninstall the 1.x version which would clear the system record.

hass’s picture

Title: Upgrade: 1.x to 2.x - SQL warnings » Upgrade path from 1.x branch is missing
Status: Closed (works as designed) » Active

Sorry, but don't you think that you should add an upgrade function as all other modules also do? Maybe with upgrade number 6000 that installs the schema because hook_install is not executed again? This would be a clean upgrade. You shouldn't leave the people alone with this heavy task. Editing system tables is out of scope for beginners and hacking core tables is also often out of scope for non-core developers and don't forget that others install this module to use it - not to review it first and waste 2 days in analysing why it is broken!

Add a clean upgrade path, please.

hass’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new3.88 KB

Patch attached, but not yet tested. I will test this later the day and report back.

hass’s picture

Assigned: Unassigned »
Status: Needs review » Needs work
hass’s picture

Status: Needs work » Needs review
StatusFileSize
new7.19 KB

Reworked patch as I've found much more bugs then the missing schema install bug only. This patch has been tested with 6.x-1.2 to 6.x-2.5 and the upgrade now works as expected and required. I have analysed all releases since 2.1 to figure out all upgrade bugs and to fix them. Schema module now reports that all existing tables match the schema.

Bugs fixed:
1. Allows simpletest upgrade from 6.x-1.2 to 6.x-2.x.
2. Generates binary and text test files on upgrade.
3. Uninstall removes binary and text test files.
4. Translatable string fixes. (Line breaks are not allowed.)
5. A few other minor code style issues have been fixed.

hass’s picture

Title: Upgrade path from 1.x branch is missing » Multiple upgrade bugfixes for simpletest
hass’s picture

StatusFileSize
new7.39 KB

Added - Drop table to make sure field 'test_id' and primary key is fixed (6.x-2.1 bug fixed in 6.x-2.2). Nevertheless 2.1 people cannot get into this update hook as they already have schema version 7000. This is a nobrainer to me - maybe better go with #8 patch only. This patch haven't been re-tested by me.

boombatower’s picture

The remove files should be done in 7.x core as that is a valid feature.

hass’s picture

Sorry, but what do you mean? The uninstall part? It's a must for D6 and D7 - not only D7. If I uninstall a module I expect that my machine get cleaned up and reverted to pre-simpletest installation. As more I'm thinking about this - the "Clean environment" of stale simpeltest data must also been executed on uninstall. This is currently missing in my patch.

We should add:

simpletest_clean_database();
simpletest_clean_temporary_directories();

or

simpletest_clean_environment();

But this could become an extra case.

boombatower’s picture

Status: Needs review » Fixed

Committed the update portion, but not the uninstall part.

Please create an issue in Drupal 7.x SimpleTest component and get it committed to core which will then be backported to 6.x.

Status: Fixed » Closed (fixed)

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