diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-23 10:49:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-23 10:49:45 +0200 |
commit | f89189907bbdff6c4bc6d3460ed9ef4c49515f17 (patch) | |
tree | c55e50e3fc02ae9b3f2d1d19d95160af98cc7d7c /server/tests/peertube-runner/vod-transcoding.ts | |
parent | 41cde76bbf5ac16a90b5f158672523069db74009 (diff) | |
download | PeerTube-f89189907bbdff6c4bc6d3460ed9ef4c49515f17.tar.gz PeerTube-f89189907bbdff6c4bc6d3460ed9ef4c49515f17.tar.zst PeerTube-f89189907bbdff6c4bc6d3460ed9ef4c49515f17.zip |
Prevent object storage mock conflicts
When running tests in parallel
Diffstat (limited to 'server/tests/peertube-runner/vod-transcoding.ts')
-rw-r--r-- | server/tests/peertube-runner/vod-transcoding.ts | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.ts index dc505baab..aefec394d 100644 --- a/server/tests/peertube-runner/vod-transcoding.ts +++ b/server/tests/peertube-runner/vod-transcoding.ts | |||
@@ -26,16 +26,16 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
26 | function runSuite (options: { | 26 | function runSuite (options: { |
27 | webtorrentEnabled: boolean | 27 | webtorrentEnabled: boolean |
28 | hlsEnabled: boolean | 28 | hlsEnabled: boolean |
29 | objectStorage: boolean | 29 | objectStorage?: ObjectStorageCommand |
30 | }) { | 30 | }) { |
31 | const { webtorrentEnabled, hlsEnabled, objectStorage } = options | 31 | const { webtorrentEnabled, hlsEnabled, objectStorage } = options |
32 | 32 | ||
33 | const objectStorageBaseUrlWebTorrent = objectStorage | 33 | const objectStorageBaseUrlWebTorrent = objectStorage |
34 | ? ObjectStorageCommand.getMockWebTorrentBaseUrl() | 34 | ? objectStorage.getMockWebVideosBaseUrl() |
35 | : undefined | 35 | : undefined |
36 | 36 | ||
37 | const objectStorageBaseUrlHLS = objectStorage | 37 | const objectStorageBaseUrlHLS = objectStorage |
38 | ? ObjectStorageCommand.getMockPlaylistBaseUrl() | 38 | ? objectStorage.getMockPlaylistBaseUrl() |
39 | : undefined | 39 | : undefined |
40 | 40 | ||
41 | it('Should upload a classic video mp4 and transcode it', async function () { | 41 | it('Should upload a classic video mp4 and transcode it', async function () { |
@@ -262,7 +262,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
262 | await servers[0].config.enableTranscoding(true, false, true) | 262 | await servers[0].config.enableTranscoding(true, false, true) |
263 | }) | 263 | }) |
264 | 264 | ||
265 | runSuite({ webtorrentEnabled: true, hlsEnabled: false, objectStorage: false }) | 265 | runSuite({ webtorrentEnabled: true, hlsEnabled: false }) |
266 | }) | 266 | }) |
267 | 267 | ||
268 | describe('HLS videos only enabled', function () { | 268 | describe('HLS videos only enabled', function () { |
@@ -271,7 +271,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
271 | await servers[0].config.enableTranscoding(false, true, true) | 271 | await servers[0].config.enableTranscoding(false, true, true) |
272 | }) | 272 | }) |
273 | 273 | ||
274 | runSuite({ webtorrentEnabled: false, hlsEnabled: true, objectStorage: false }) | 274 | runSuite({ webtorrentEnabled: false, hlsEnabled: true }) |
275 | }) | 275 | }) |
276 | 276 | ||
277 | describe('Web video & HLS enabled', function () { | 277 | describe('Web video & HLS enabled', function () { |
@@ -280,19 +280,21 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
280 | await servers[0].config.enableTranscoding(true, true, true) | 280 | await servers[0].config.enableTranscoding(true, true, true) |
281 | }) | 281 | }) |
282 | 282 | ||
283 | runSuite({ webtorrentEnabled: true, hlsEnabled: true, objectStorage: false }) | 283 | runSuite({ webtorrentEnabled: true, hlsEnabled: true }) |
284 | }) | 284 | }) |
285 | }) | 285 | }) |
286 | 286 | ||
287 | describe('With videos on object storage', function () { | 287 | describe('With videos on object storage', function () { |
288 | if (areMockObjectStorageTestsDisabled()) return | 288 | if (areMockObjectStorageTestsDisabled()) return |
289 | 289 | ||
290 | const objectStorage = new ObjectStorageCommand() | ||
291 | |||
290 | before(async function () { | 292 | before(async function () { |
291 | await ObjectStorageCommand.prepareDefaultMockBuckets() | 293 | await objectStorage.prepareDefaultMockBuckets() |
292 | 294 | ||
293 | await servers[0].kill() | 295 | await servers[0].kill() |
294 | 296 | ||
295 | await servers[0].run(ObjectStorageCommand.getDefaultMockConfig()) | 297 | await servers[0].run(objectStorage.getDefaultMockConfig()) |
296 | 298 | ||
297 | // Wait for peertube runner socket reconnection | 299 | // Wait for peertube runner socket reconnection |
298 | await wait(1500) | 300 | await wait(1500) |
@@ -304,7 +306,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
304 | await servers[0].config.enableTranscoding(true, false, true) | 306 | await servers[0].config.enableTranscoding(true, false, true) |
305 | }) | 307 | }) |
306 | 308 | ||
307 | runSuite({ webtorrentEnabled: true, hlsEnabled: false, objectStorage: true }) | 309 | runSuite({ webtorrentEnabled: true, hlsEnabled: false, objectStorage }) |
308 | }) | 310 | }) |
309 | 311 | ||
310 | describe('HLS videos only enabled', function () { | 312 | describe('HLS videos only enabled', function () { |
@@ -313,7 +315,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
313 | await servers[0].config.enableTranscoding(false, true, true) | 315 | await servers[0].config.enableTranscoding(false, true, true) |
314 | }) | 316 | }) |
315 | 317 | ||
316 | runSuite({ webtorrentEnabled: false, hlsEnabled: true, objectStorage: true }) | 318 | runSuite({ webtorrentEnabled: false, hlsEnabled: true, objectStorage }) |
317 | }) | 319 | }) |
318 | 320 | ||
319 | describe('Web video & HLS enabled', function () { | 321 | describe('Web video & HLS enabled', function () { |
@@ -322,7 +324,11 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
322 | await servers[0].config.enableTranscoding(true, true, true) | 324 | await servers[0].config.enableTranscoding(true, true, true) |
323 | }) | 325 | }) |
324 | 326 | ||
325 | runSuite({ webtorrentEnabled: true, hlsEnabled: true, objectStorage: true }) | 327 | runSuite({ webtorrentEnabled: true, hlsEnabled: true, objectStorage }) |
328 | }) | ||
329 | |||
330 | after(async function () { | ||
331 | await objectStorage.cleanupMock() | ||
326 | }) | 332 | }) |
327 | }) | 333 | }) |
328 | 334 | ||