X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Faudio-only.ts;h=f4b635bd5cbac711d15d62b3116c226828e6acb5;hb=b46cf4b920984492df598c1b61179acfc7f6f22e;hp=b2952e38b50f6af6c4e998c53711309f5897b0bb;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts index b2952e38b..f4b635bd5 100644 --- a/server/tests/api/videos/audio-only.ts +++ b/server/tests/api/videos/audio-only.ts @@ -2,15 +2,16 @@ import 'mocha' import * as chai from 'chai' -import { join } from 'path' import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' -import { cleanupTests, doubleFollow, flushAndRunMultipleServers, ServerInfo, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' +import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' const expect = chai.expect describe('Test audio only video transcoding', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let videoUUID: string + let webtorrentAudioFileUrl: string + let fragmentedAudioFileUrl: string before(async function () { this.timeout(120000) @@ -20,6 +21,7 @@ describe('Test audio only video transcoding', function () { enabled: true, resolutions: { '0p': true, + '144p': false, '240p': true, '360p': false, '480p': false, @@ -36,7 +38,7 @@ describe('Test audio only video transcoding', function () { } } } - servers = await flushAndRunMultipleServers(2, configOverride) + servers = await createMultipleServers(2, configOverride) // Get the access tokens await setAccessTokensToServers(servers) @@ -63,13 +65,18 @@ describe('Test audio only video transcoding', function () { expect(files[1].resolution.id).to.equal(240) expect(files[2].resolution.id).to.equal(0) } + + if (server.serverNumber === 1) { + webtorrentAudioFileUrl = video.files[2].fileUrl + fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl + } } }) it('0p transcoded video should not have video', async function () { const paths = [ - servers[0].servers.buildDirectory(join('videos', videoUUID + '-0.mp4')), - servers[0].servers.buildDirectory(join('streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4')) + servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl), + servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl) ] for (const path of paths) {