mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-23 06:38:19 +02:00
ci enhancement: complete tearDown to cleanup transactions and cmdb changes properly
This commit is contained in:
@@ -136,6 +136,8 @@ class ItopDataTestCase extends ItopTestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMDBObject::SetCurrentChange(null);
|
||||||
|
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ class ItopTestCase extends TestCase
|
|||||||
|
|
||||||
if (CMDBSource::IsInsideTransaction()) {
|
if (CMDBSource::IsInsideTransaction()) {
|
||||||
// Nested transactions were opened but not finished !
|
// Nested transactions were opened but not finished !
|
||||||
|
// Rollback to avoid side effects on next tests
|
||||||
|
while (CMDBSource::IsInsideTransaction()) {
|
||||||
|
CMDBSource::Query('ROLLBACK');
|
||||||
|
}
|
||||||
throw new MySQLTransactionNotClosedException('Some DB transactions were opened but not closed ! Fix the code by adding ROLLBACK or COMMIT statements !', []);
|
throw new MySQLTransactionNotClosedException('Some DB transactions were opened but not closed ! Fix the code by adding ROLLBACK or COMMIT statements !', []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,4 +316,4 @@ class ItopTestCase extends TestCase
|
|||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user