X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive.ts;h=f9b0d257bc846c9863663e6b8dbef143358afb13;hb=a687879e94fa5d3ecdd76bec3d94d0e1698ee913;hp=ceb606af1361a212a8a91a3921b7b09ae96188f7;hpb=05a60d85997c108d39bcfb14f1ffd4c74f8b1e93;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index ceb606af1..f9b0d257b 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -2,9 +2,9 @@ import { expect } from 'chai' import { basename, join } from 'path' -import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg' -import { testImage, testVideoResolutions } from '@server/tests/shared' +import { SQLCommand, testImage, testLiveVideoResolutions } from '@server/tests/shared' import { getAllFiles, wait } from '@shared/core-utils' +import { ffprobePromise, getVideoStream } from '@shared/ffmpeg' import { HttpStatusCode, LiveVideo, @@ -365,6 +365,7 @@ describe('Test live', function () { describe('Live transcoding', function () { let liveVideoId: string + let sqlCommandServer1: SQLCommand async function createLiveWrapper (saveReplay: boolean) { const liveAttributes = { @@ -407,6 +408,8 @@ describe('Test live', function () { before(async function () { await updateConf([]) + + sqlCommandServer1 = new SQLCommand(servers[0]) }) it('Should enable transcoding without additional resolutions', async function () { @@ -418,8 +421,9 @@ describe('Test live', function () { await waitUntilLivePublishedOnAllServers(servers, liveVideoId) await waitJobs(servers) - await testVideoResolutions({ + await testLiveVideoResolutions({ originServer: servers[0], + sqlCommand: sqlCommandServer1, servers, liveVideoId, resolutions: [ 720 ], @@ -453,8 +457,9 @@ describe('Test live', function () { await waitUntilLivePublishedOnAllServers(servers, liveVideoId) await waitJobs(servers) - await testVideoResolutions({ + await testLiveVideoResolutions({ originServer: servers[0], + sqlCommand: sqlCommandServer1, servers, liveVideoId, resolutions: resolutions.concat([ 720 ]), @@ -505,8 +510,9 @@ describe('Test live', function () { await waitUntilLivePublishedOnAllServers(servers, liveVideoId) await waitJobs(servers) - await testVideoResolutions({ + await testLiveVideoResolutions({ originServer: servers[0], + sqlCommand: sqlCommandServer1, servers, liveVideoId, resolutions, @@ -601,8 +607,9 @@ describe('Test live', function () { await waitUntilLivePublishedOnAllServers(servers, liveVideoId) await waitJobs(servers) - await testVideoResolutions({ + await testLiveVideoResolutions({ originServer: servers[0], + sqlCommand: sqlCommandServer1, servers, liveVideoId, resolutions, @@ -637,8 +644,9 @@ describe('Test live', function () { await waitUntilLivePublishedOnAllServers(servers, liveVideoId) await waitJobs(servers) - await testVideoResolutions({ + await testLiveVideoResolutions({ originServer: servers[0], + sqlCommand: sqlCommandServer1, servers, liveVideoId, resolutions: [ 720 ], @@ -661,6 +669,10 @@ describe('Test live', function () { expect(hlsFiles[0].resolution.id).to.equal(720) }) + + after(async function () { + await sqlCommandServer1.cleanup() + }) }) describe('After a server restart', function () {