镜像自地址
https://github.com/nextcloud/server.git
已同步 2024-08-26 17:55:04 +02:00
Added check and cleanup for storage/filecache
Some tests don't clean up the file cache and sometimes entries are reused by mistake in subsequent test suites. This cleans up the file cache and storage after every test suite and also shows an annoying warning.
这个提交包含在:
父节点
5def2a72dd
当前提交
19c73a8464
@ -41,6 +41,12 @@ class TestCleanupListener implements PHPUnit_Framework_TestListener {
|
||||
}
|
||||
|
||||
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
|
||||
if ($this->cleanStorages() && $this->isShowSuiteWarning()) {
|
||||
printf("TestSuite '%s': Did not clean up storages\n", $suite->getName());
|
||||
}
|
||||
if ($this->cleanFileCache() && $this->isShowSuiteWarning()) {
|
||||
printf("TestSuite '%s': Did not clean up file cache\n", $suite->getName());
|
||||
}
|
||||
if ($this->cleanStrayDataFiles() && $this->isShowSuiteWarning()) {
|
||||
printf("TestSuite '%s': Did not clean up data dir\n", $suite->getName());
|
||||
}
|
||||
@ -114,6 +120,26 @@ class TestCleanupListener implements PHPUnit_Framework_TestListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function cleanStorages() {
|
||||
$sql = 'DELETE FROM `*PREFIX*storages`';
|
||||
$query = \OC_DB::prepare( $sql );
|
||||
$result = $query->execute();
|
||||
if ($result > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function cleanFileCache() {
|
||||
$sql = 'DELETE FROM `*PREFIX*filecache`';
|
||||
$query = \OC_DB::prepare( $sql );
|
||||
$result = $query->execute();
|
||||
if ($result > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function cleanStrayHooks() {
|
||||
$hasHooks = false;
|
||||
$hooks = OC_Hook::getHooks();
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户