diff options
author | Robin Appelman <robin@icewind.nl> | 2024-08-15 18:04:55 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-08-28 10:27:14 +0200 |
commit | b21a399d1a7fab83ff80bc637c176915d3460f2b (patch) | |
tree | 19bd20b2640275d01401a4c093aad1ae6b736b78 /tests | |
parent | cc091b150eb370f16d3c7a076d912b08878af96e (diff) | |
download | nextcloud-server-b21a399d1a7fab83ff80bc637c176915d3460f2b.tar.gz nextcloud-server-b21a399d1a7fab83ff80bc637c176915d3460f2b.zip |
fix: implement sharding compatible cleanup for various bits
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Preview/BackgroundCleanupJobTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Repair/CleanTagsTest.php | 13 |
2 files changed, 10 insertions, 11 deletions
diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index c07ec42b36b..ccd5dba69cf 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -146,6 +146,10 @@ class BackgroundCleanupJobTest extends \Test\TestCase { } public function testCleanupAjax() { + if ($this->connection->getShardDefinition('filecache')) { + $this->markTestSkipped("ajax cron is not supported for sharded setups"); + return; + } $files = $this->setup11Previews(); $fileIds = array_map(function (File $f) { return $f->getId(); @@ -174,6 +178,10 @@ class BackgroundCleanupJobTest extends \Test\TestCase { } public function testOldPreviews() { + if ($this->connection->getShardDefinition('filecache')) { + $this->markTestSkipped("old previews are not supported for sharded setups"); + return; + } $appdata = \OC::$server->getAppDataDir('preview'); $f1 = $appdata->newFolder('123456781'); diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php index f2e62b85aca..11430cc1215 100644 --- a/tests/lib/Repair/CleanTagsTest.php +++ b/tests/lib/Repair/CleanTagsTest.php @@ -142,7 +142,7 @@ class CleanTagsTest extends \Test\TestCase { ]) ->execute(); - return (int)$this->getLastInsertID('vcategory', 'id'); + return $qb->getLastInsertId(); } /** @@ -191,16 +191,7 @@ class CleanTagsTest extends \Test\TestCase { ]) ->execute(); - $this->createdFile = (int)$this->getLastInsertID('filecache', 'fileid'); + $this->createdFile = $qb->getLastInsertId(); return $this->createdFile; } - - /** - * @param $tableName - * @param $idName - * @return int - */ - protected function getLastInsertID($tableName, $idName) { - return $this->connection->lastInsertId("*PREFIX*$tableName"); - } } |