Skip to content

Commit 83f8547

Browse files
committed
fix unit test upload.
- make upload testing more informative. - fix subtitle upload on opencast 15.x
1 parent 702588d commit 83f8547

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

classes/local/attachment_helper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,13 @@ public static function upload_transcription_captions_set($storedlanguagefiles, $
423423
foreach ($storedlanguagefiles as $lang => $file) {
424424
$subtitletags = $basesubtitletags;
425425
$subtitletags[] = "lang:$lang";
426-
$filestream = $apibridge->get_upload_filestream($file, 'file');
427426
$mediapackagestr = self::removing_existing_transcription_in_mediapackage(
428427
$mediapackagestr,
429428
$mainmanualflavor,
430429
$subtitletags
431430
);
432431
// Now that the existing are removed, we perform the add track via ingest.
433-
$mediapackagestr = $apibridge->ingest_add_track($mediapackagestr, $mainmanualflavor, $filestream, $subtitletags);
432+
$mediapackagestr = $apibridge->ingest_add_track($mediapackagestr, $mainmanualflavor, $file, $subtitletags);
434433
}
435434
}
436435

tests/upload_ingest_with_configpanel_test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function test_upload_ingest_configpanel(): void {
8989
set_config('apiconnecttimeout_1', $this->apiconnecttimeout, 'tool_opencast');
9090
// Block settings.
9191
set_config('ingestupload_1', 1, 'block_opencast');
92-
set_config('uploadworkflow_1', 'schedule-and-upload', 'block_opencast');
92+
set_config('uploadworkflow_1', 'fast', 'block_opencast');
9393
set_config('enableuploadwfconfigpanel_1', 1, 'block_opencast');
9494
set_config('alloweduploadwfconfigs_1', 'straightToPublishing', 'block_opencast');
9595
set_config('limituploadjobs_1', 2, 'block_opencast');
@@ -160,6 +160,8 @@ public function test_upload_ingest_configpanel(): void {
160160
}
161161
} while (!$isuploaded);
162162

163+
$this->assertEquals(true, $isuploaded, 'Video was not uploaded after reaching the maximum number of retries.');
164+
163165
// Check if video was uploaded.
164166
$videos = $apibridge->get_course_videos($course->id);
165167

tests/upload_test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public function test_upload(): void {
146146
}
147147
} while (!$isuploaded);
148148

149+
$this->assertEquals(true, $isuploaded, 'Video was not uploaded after reaching the maximum number of retries.');
150+
149151
// Check if video was uploaded.
150152
$videos = $apibridge->get_course_videos($course->id);
151153

@@ -229,7 +231,7 @@ private function notest_check_processed_video($identifier, $apibridge) {
229231
*/
230232
private function notest_ensure_video_processed($identifier, $apibridge) {
231233
$isprocessed = false;
232-
$limiter = 15;
234+
$limiter = 40;
233235
$counter = 0;
234236
do {
235237
$isprocessed = $this->notest_check_processed_video($identifier, $apibridge);

0 commit comments

Comments
 (0)