diff options
Diffstat (limited to 'server/tests/api/object-storage/videos.ts')
-rw-r--r-- | server/tests/api/object-storage/videos.ts | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts index f837d9966..c4f72bbe4 100644 --- a/server/tests/api/object-storage/videos.ts +++ b/server/tests/api/object-storage/videos.ts | |||
@@ -41,8 +41,8 @@ async function checkFiles (options: { | |||
41 | playlistBucket: string | 41 | playlistBucket: string |
42 | playlistPrefix?: string | 42 | playlistPrefix?: string |
43 | 43 | ||
44 | webtorrentBucket: string | 44 | webVideoBucket: string |
45 | webtorrentPrefix?: string | 45 | webVideoPrefix?: string |
46 | }) { | 46 | }) { |
47 | const { | 47 | const { |
48 | server, | 48 | server, |
@@ -50,20 +50,20 @@ async function checkFiles (options: { | |||
50 | originSQLCommand, | 50 | originSQLCommand, |
51 | video, | 51 | video, |
52 | playlistBucket, | 52 | playlistBucket, |
53 | webtorrentBucket, | 53 | webVideoBucket, |
54 | baseMockUrl, | 54 | baseMockUrl, |
55 | playlistPrefix, | 55 | playlistPrefix, |
56 | webtorrentPrefix | 56 | webVideoPrefix |
57 | } = options | 57 | } = options |
58 | 58 | ||
59 | let allFiles = video.files | 59 | let allFiles = video.files |
60 | 60 | ||
61 | for (const file of video.files) { | 61 | for (const file of video.files) { |
62 | const baseUrl = baseMockUrl | 62 | const baseUrl = baseMockUrl |
63 | ? `${baseMockUrl}/${webtorrentBucket}/` | 63 | ? `${baseMockUrl}/${webVideoBucket}/` |
64 | : `http://${webtorrentBucket}.${ObjectStorageCommand.getMockEndpointHost()}/` | 64 | : `http://${webVideoBucket}.${ObjectStorageCommand.getMockEndpointHost()}/` |
65 | 65 | ||
66 | const prefix = webtorrentPrefix || '' | 66 | const prefix = webVideoPrefix || '' |
67 | const start = baseUrl + prefix | 67 | const start = baseUrl + prefix |
68 | 68 | ||
69 | expectStartWith(file.fileUrl, start) | 69 | expectStartWith(file.fileUrl, start) |
@@ -134,8 +134,8 @@ function runTestSuite (options: { | |||
134 | playlistBucket: string | 134 | playlistBucket: string |
135 | playlistPrefix?: string | 135 | playlistPrefix?: string |
136 | 136 | ||
137 | webtorrentBucket: string | 137 | webVideoBucket: string |
138 | webtorrentPrefix?: string | 138 | webVideoPrefix?: string |
139 | 139 | ||
140 | useMockBaseUrl?: boolean | 140 | useMockBaseUrl?: boolean |
141 | }) { | 141 | }) { |
@@ -161,7 +161,7 @@ function runTestSuite (options: { | |||
161 | : undefined | 161 | : undefined |
162 | 162 | ||
163 | await objectStorage.createMockBucket(options.playlistBucket) | 163 | await objectStorage.createMockBucket(options.playlistBucket) |
164 | await objectStorage.createMockBucket(options.webtorrentBucket) | 164 | await objectStorage.createMockBucket(options.webVideoBucket) |
165 | 165 | ||
166 | const config = { | 166 | const config = { |
167 | object_storage: { | 167 | object_storage: { |
@@ -182,10 +182,10 @@ function runTestSuite (options: { | |||
182 | }, | 182 | }, |
183 | 183 | ||
184 | videos: { | 184 | videos: { |
185 | bucket_name: options.webtorrentBucket, | 185 | bucket_name: options.webVideoBucket, |
186 | prefix: options.webtorrentPrefix, | 186 | prefix: options.webVideoPrefix, |
187 | base_url: baseMockUrl | 187 | base_url: baseMockUrl |
188 | ? `${baseMockUrl}/${options.webtorrentBucket}` | 188 | ? `${baseMockUrl}/${options.webVideoBucket}` |
189 | : undefined | 189 | : undefined |
190 | } | 190 | } |
191 | } | 191 | } |
@@ -386,27 +386,27 @@ describe('Object storage for videos', function () { | |||
386 | describe('Test simple object storage', function () { | 386 | describe('Test simple object storage', function () { |
387 | runTestSuite({ | 387 | runTestSuite({ |
388 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), | 388 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), |
389 | webtorrentBucket: objectStorage.getMockBucketName('videos') | 389 | webVideoBucket: objectStorage.getMockBucketName('videos') |
390 | }) | 390 | }) |
391 | }) | 391 | }) |
392 | 392 | ||
393 | describe('Test object storage with prefix', function () { | 393 | describe('Test object storage with prefix', function () { |
394 | runTestSuite({ | 394 | runTestSuite({ |
395 | playlistBucket: objectStorage.getMockBucketName('mybucket'), | 395 | playlistBucket: objectStorage.getMockBucketName('mybucket'), |
396 | webtorrentBucket: objectStorage.getMockBucketName('mybucket'), | 396 | webVideoBucket: objectStorage.getMockBucketName('mybucket'), |
397 | 397 | ||
398 | playlistPrefix: 'streaming-playlists_', | 398 | playlistPrefix: 'streaming-playlists_', |
399 | webtorrentPrefix: 'webtorrent_' | 399 | webVideoPrefix: 'webvideo_' |
400 | }) | 400 | }) |
401 | }) | 401 | }) |
402 | 402 | ||
403 | describe('Test object storage with prefix and base URL', function () { | 403 | describe('Test object storage with prefix and base URL', function () { |
404 | runTestSuite({ | 404 | runTestSuite({ |
405 | playlistBucket: objectStorage.getMockBucketName('mybucket'), | 405 | playlistBucket: objectStorage.getMockBucketName('mybucket'), |
406 | webtorrentBucket: objectStorage.getMockBucketName('mybucket'), | 406 | webVideoBucket: objectStorage.getMockBucketName('mybucket'), |
407 | 407 | ||
408 | playlistPrefix: 'streaming-playlists/', | 408 | playlistPrefix: 'streaming-playlists/', |
409 | webtorrentPrefix: 'webtorrent/', | 409 | webVideoPrefix: 'webvideo/', |
410 | 410 | ||
411 | useMockBaseUrl: true | 411 | useMockBaseUrl: true |
412 | }) | 412 | }) |
@@ -431,7 +431,7 @@ describe('Object storage for videos', function () { | |||
431 | runTestSuite({ | 431 | runTestSuite({ |
432 | maxUploadPart, | 432 | maxUploadPart, |
433 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), | 433 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), |
434 | webtorrentBucket: objectStorage.getMockBucketName('videos'), | 434 | webVideoBucket: objectStorage.getMockBucketName('videos'), |
435 | fixture | 435 | fixture |
436 | }) | 436 | }) |
437 | }) | 437 | }) |