diff options
Diffstat (limited to 'server/tests/api/object-storage/live.ts')
-rw-r--r-- | server/tests/api/object-storage/live.ts | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/server/tests/api/object-storage/live.ts b/server/tests/api/object-storage/live.ts index 588e0a8d7..c430cd0a0 100644 --- a/server/tests/api/object-storage/live.ts +++ b/server/tests/api/object-storage/live.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { expectStartWith, MockObjectStorageProxy, testVideoResolutions } from '@server/tests/shared' | 4 | import { expectStartWith, MockObjectStorageProxy, SQLCommand, testLiveVideoResolutions } from '@server/tests/shared' |
5 | import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' | 5 | import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' |
7 | import { | 7 | import { |
@@ -79,6 +79,7 @@ describe('Object storage for lives', function () { | |||
79 | if (areMockObjectStorageTestsDisabled()) return | 79 | if (areMockObjectStorageTestsDisabled()) return |
80 | 80 | ||
81 | let servers: PeerTubeServer[] | 81 | let servers: PeerTubeServer[] |
82 | let sqlCommandServer1: SQLCommand | ||
82 | 83 | ||
83 | before(async function () { | 84 | before(async function () { |
84 | this.timeout(120000) | 85 | this.timeout(120000) |
@@ -92,6 +93,8 @@ describe('Object storage for lives', function () { | |||
92 | await doubleFollow(servers[0], servers[1]) | 93 | await doubleFollow(servers[0], servers[1]) |
93 | 94 | ||
94 | await servers[0].config.enableTranscoding() | 95 | await servers[0].config.enableTranscoding() |
96 | |||
97 | sqlCommandServer1 = new SQLCommand(servers[0]) | ||
95 | }) | 98 | }) |
96 | 99 | ||
97 | describe('Without live transcoding', function () { | 100 | describe('Without live transcoding', function () { |
@@ -109,8 +112,9 @@ describe('Object storage for lives', function () { | |||
109 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID }) | 112 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID }) |
110 | await waitUntilLivePublishedOnAllServers(servers, videoUUID) | 113 | await waitUntilLivePublishedOnAllServers(servers, videoUUID) |
111 | 114 | ||
112 | await testVideoResolutions({ | 115 | await testLiveVideoResolutions({ |
113 | originServer: servers[0], | 116 | originServer: servers[0], |
117 | sqlCommand: sqlCommandServer1, | ||
114 | servers, | 118 | servers, |
115 | liveVideoId: videoUUID, | 119 | liveVideoId: videoUUID, |
116 | resolutions: [ 720 ], | 120 | resolutions: [ 720 ], |
@@ -155,8 +159,9 @@ describe('Object storage for lives', function () { | |||
155 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDNonPermanent }) | 159 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDNonPermanent }) |
156 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDNonPermanent) | 160 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDNonPermanent) |
157 | 161 | ||
158 | await testVideoResolutions({ | 162 | await testLiveVideoResolutions({ |
159 | originServer: servers[0], | 163 | originServer: servers[0], |
164 | sqlCommand: sqlCommandServer1, | ||
160 | servers, | 165 | servers, |
161 | liveVideoId: videoUUIDNonPermanent, | 166 | liveVideoId: videoUUIDNonPermanent, |
162 | resolutions, | 167 | resolutions, |
@@ -194,8 +199,9 @@ describe('Object storage for lives', function () { | |||
194 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDPermanent }) | 199 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDPermanent }) |
195 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDPermanent) | 200 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDPermanent) |
196 | 201 | ||
197 | await testVideoResolutions({ | 202 | await testLiveVideoResolutions({ |
198 | originServer: servers[0], | 203 | originServer: servers[0], |
204 | sqlCommand: sqlCommandServer1, | ||
199 | servers, | 205 | servers, |
200 | liveVideoId: videoUUIDPermanent, | 206 | liveVideoId: videoUUIDPermanent, |
201 | resolutions, | 207 | resolutions, |
@@ -266,8 +272,9 @@ describe('Object storage for lives', function () { | |||
266 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDPermanent }) | 272 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUIDPermanent }) |
267 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDPermanent) | 273 | await waitUntilLivePublishedOnAllServers(servers, videoUUIDPermanent) |
268 | 274 | ||
269 | await testVideoResolutions({ | 275 | await testLiveVideoResolutions({ |
270 | originServer: servers[0], | 276 | originServer: servers[0], |
277 | sqlCommand: sqlCommandServer1, | ||
271 | servers, | 278 | servers, |
272 | liveVideoId: videoUUIDPermanent, | 279 | liveVideoId: videoUUIDPermanent, |
273 | resolutions: [ 720 ], | 280 | resolutions: [ 720 ], |
@@ -281,6 +288,8 @@ describe('Object storage for lives', function () { | |||
281 | }) | 288 | }) |
282 | 289 | ||
283 | after(async function () { | 290 | after(async function () { |
291 | await sqlCommandServer1.cleanup() | ||
292 | |||
284 | await killallServers(servers) | 293 | await killallServers(servers) |
285 | }) | 294 | }) |
286 | }) | 295 | }) |