← Back to team overview

mahara-contributors team mailing list archive

[Bug 1723286] [NEW] Rerunning unit tests fails with DB error

 

Public bug reported:

On master.

When you rerun unit tests they fail with:

[DBG] 9d (lib/dml.php:157) postgres8 error: [-1: ERROR:  cannot drop constraint tst_fram_id_pk on table tst_framework because other objects depend on it
[DBG] 9d (lib/dml.php:157) DETAIL:  constraint tst_coll_fra_fk on table tst_collection depends on index tst_fram_id_pk
[DBG] 9d (lib/dml.php:157) HINT:  Use DROP ... CASCADE to drop the dependent objects too.] in EXECUTE("ALTER TABLE tst_framework DROP CONSTRAINT tst_fram_id_pk")Command was: ALTER TABLE tst_framework DROP CONSTRAINT tst_fram_id_pk
[DBG] 9d (lib/dml.php:157) postgres8 error: [-1: ERROR:  cannot drop table tst_framework because other objects depend on it
[DBG] 9d (lib/dml.php:157) DETAIL:  constraint tst_coll_fra_fk on table tst_collection depends on table tst_framework
[DBG] 9d (lib/dml.php:157) HINT:  Use DROP ... CASCADE to drop the dependent objects too.] in EXECUTE("DROP TABLE tst_framework")Command was: DROP TABLE tst_framework

This happens because we don't clean up coll_fra_fk index on {collection} table when uninstalling.
The proper fix would be to use the same set of functions for behat and unit tests when we drop a site.

** Affects: mahara
     Importance: Medium
     Assignee: Dmitrii Metelkin (dmitriim)
         Status: Confirmed

** Changed in: mahara
       Status: New => Confirmed

** Changed in: mahara
     Assignee: (unassigned) => Dmitrii Metelkin (dmitriim)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1723286

Title:
  Rerunning unit tests fails with DB error

Status in Mahara:
  Confirmed

Bug description:
  On master.

  When you rerun unit tests they fail with:

  [DBG] 9d (lib/dml.php:157) postgres8 error: [-1: ERROR:  cannot drop constraint tst_fram_id_pk on table tst_framework because other objects depend on it
  [DBG] 9d (lib/dml.php:157) DETAIL:  constraint tst_coll_fra_fk on table tst_collection depends on index tst_fram_id_pk
  [DBG] 9d (lib/dml.php:157) HINT:  Use DROP ... CASCADE to drop the dependent objects too.] in EXECUTE("ALTER TABLE tst_framework DROP CONSTRAINT tst_fram_id_pk")Command was: ALTER TABLE tst_framework DROP CONSTRAINT tst_fram_id_pk
  [DBG] 9d (lib/dml.php:157) postgres8 error: [-1: ERROR:  cannot drop table tst_framework because other objects depend on it
  [DBG] 9d (lib/dml.php:157) DETAIL:  constraint tst_coll_fra_fk on table tst_collection depends on table tst_framework
  [DBG] 9d (lib/dml.php:157) HINT:  Use DROP ... CASCADE to drop the dependent objects too.] in EXECUTE("DROP TABLE tst_framework")Command was: DROP TABLE tst_framework

  This happens because we don't clean up coll_fra_fk index on {collection} table when uninstalling.
  The proper fix would be to use the same set of functions for behat and unit tests when we drop a site.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1723286/+subscriptions


Follow ups