diff options
Diffstat (limited to 'server/tests/peertube-runner/studio-transcoding.ts')
-rw-r--r-- | server/tests/peertube-runner/studio-transcoding.ts | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.ts index 400203eb3..69b38a536 100644 --- a/server/tests/peertube-runner/studio-transcoding.ts +++ b/server/tests/peertube-runner/studio-transcoding.ts | |||
@@ -19,8 +19,8 @@ describe('Test studio transcoding in peertube-runner program', function () { | |||
19 | let peertubeRunner: PeerTubeRunnerProcess | 19 | let peertubeRunner: PeerTubeRunnerProcess |
20 | 20 | ||
21 | function runSuite (options: { | 21 | function runSuite (options: { |
22 | objectStorage: boolean | 22 | objectStorage?: ObjectStorageCommand |
23 | }) { | 23 | } = {}) { |
24 | const { objectStorage } = options | 24 | const { objectStorage } = options |
25 | 25 | ||
26 | it('Should run a complex studio transcoding', async function () { | 26 | it('Should run a complex studio transcoding', async function () { |
@@ -45,11 +45,11 @@ describe('Test studio transcoding in peertube-runner program', function () { | |||
45 | 45 | ||
46 | if (objectStorage) { | 46 | if (objectStorage) { |
47 | for (const webtorrentFile of video.files) { | 47 | for (const webtorrentFile of video.files) { |
48 | expectStartWith(webtorrentFile.fileUrl, ObjectStorageCommand.getMockWebTorrentBaseUrl()) | 48 | expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) |
49 | } | 49 | } |
50 | 50 | ||
51 | for (const hlsFile of video.streamingPlaylists[0].files) { | 51 | for (const hlsFile of video.streamingPlaylists[0].files) { |
52 | expectStartWith(hlsFile.fileUrl, ObjectStorageCommand.getMockPlaylistBaseUrl()) | 52 | expectStartWith(hlsFile.fileUrl, objectStorage.getMockPlaylistBaseUrl()) |
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
@@ -80,24 +80,30 @@ describe('Test studio transcoding in peertube-runner program', function () { | |||
80 | }) | 80 | }) |
81 | 81 | ||
82 | describe('With videos on local filesystem storage', function () { | 82 | describe('With videos on local filesystem storage', function () { |
83 | runSuite({ objectStorage: false }) | 83 | runSuite() |
84 | }) | 84 | }) |
85 | 85 | ||
86 | describe('With videos on object storage', function () { | 86 | describe('With videos on object storage', function () { |
87 | if (areMockObjectStorageTestsDisabled()) return | 87 | if (areMockObjectStorageTestsDisabled()) return |
88 | 88 | ||
89 | const objectStorage = new ObjectStorageCommand() | ||
90 | |||
89 | before(async function () { | 91 | before(async function () { |
90 | await ObjectStorageCommand.prepareDefaultMockBuckets() | 92 | await objectStorage.prepareDefaultMockBuckets() |
91 | 93 | ||
92 | await servers[0].kill() | 94 | await servers[0].kill() |
93 | 95 | ||
94 | await servers[0].run(ObjectStorageCommand.getDefaultMockConfig()) | 96 | await servers[0].run(objectStorage.getDefaultMockConfig()) |
95 | 97 | ||
96 | // Wait for peertube runner socket reconnection | 98 | // Wait for peertube runner socket reconnection |
97 | await wait(1500) | 99 | await wait(1500) |
98 | }) | 100 | }) |
99 | 101 | ||
100 | runSuite({ objectStorage: true }) | 102 | runSuite({ objectStorage }) |
103 | |||
104 | after(async function () { | ||
105 | await objectStorage.cleanupMock() | ||
106 | }) | ||
101 | }) | 107 | }) |
102 | 108 | ||
103 | describe('Check cleanup', function () { | 109 | describe('Check cleanup', function () { |