Rerunning unit tests fails with DB error

Bug #1723286 reported by Dmitrii Metelkin on 2017-10-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Dmitrii Metelkin

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.

Changed in mahara:
status: New → Confirmed
assignee: nobody → Dmitrii Metelkin (dmitriim)
Robert Lyon (robertl-9) on 2017-10-13
Changed in mahara:
milestone: none → 18.04.0
importance: Undecided → Medium
Changed in mahara:
status: Confirmed → In Progress

Reviewed: https://reviews.mahara.org/8163
Committed: https://git.mahara.org/mahara/mahara/commit/598db823a5abe206083b2086a4e086caaee0b392
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 598db823a5abe206083b2086a4e086caaee0b392
Author: Dmitrii Metelkin <email address hidden>
Date: Thu Oct 19 16:57:17 2017 +1100

Bug 1723286: use TestingUtil::drop_database with PHPUnit tests

behatnotneeded

Change-Id: Ic42778ecf4c3c5bc90cbc81244a9744d405983fa

Robert Lyon (robertl-9) on 2017-10-20
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2018-04-05
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers