Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Sep 23, 2022
1 parent 3b30a32 commit ff22fdb
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions test/ClassifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class ClassifierTest extends TestCase {
public const TEST_USER1 = 'test-user1';

public const TEST_FILES = ['alpine.jpg' ,'eiffeltower.jpg', 'Rock_Rejam.mp3', 'jumpingjack.gif'];
const ALL_MODELS = [
ClusteringFaceClassifier::MODEL_NAME,
ImagenetClassifier::MODEL_NAME,
LandmarksClassifier::MODEL_NAME,
MovinetClassifier::MODEL_NAME,
MusicnnClassifier::MODEL_NAME,
];

private Classifier $classifier;
private OCP\Files\File $testFile;
Expand Down Expand Up @@ -85,15 +92,17 @@ public function testSchedulerJob() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]));

// cleanup
$this->jobList->remove(StorageCrawlJob::class, [
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
}

Expand All @@ -115,7 +124,8 @@ public function testImagenetPipeline() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
$crawler->setId(1);
$crawler->setLastRun(0);
Expand Down Expand Up @@ -178,7 +188,8 @@ public function testLandmarksPipeline() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
$crawler->setId(1);
$crawler->setLastRun(0);
Expand Down Expand Up @@ -263,7 +274,8 @@ public function testFacesPipeline() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
$crawler->setId(1);
$crawler->setLastRun(0);
Expand Down Expand Up @@ -347,7 +359,8 @@ public function testMovinetPipeline() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
$crawler->setId(1);
$crawler->setLastRun(0);
Expand Down Expand Up @@ -408,7 +421,8 @@ public function testMusicnnPipeline() : void {
'storage_id' => $storageId,
'root_id' => $rootId,
'override_root' => $this->userFolder->getId(),
'last_file_id' => 0
'last_file_id' => 0,
'models' => self::ALL_MODELS,
]);
$crawler->setId(1);
$crawler->setLastRun(0);
Expand Down

0 comments on commit ff22fdb

Please sign in to comment.