X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Ftranscoding%2Fcreate-transcoding.ts;h=b59bef77253d4070d27846276eb5f97ddcb539fe;hb=7804e577de25345da51ac3d88f6121108012b523;hp=a4defdf51158098628204e12131699b538a1d932;hpb=28dca0a2211524bbf3ad17666c607eb6325763b8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts index a4defdf51..b59bef772 100644 --- a/server/tests/api/transcoding/create-transcoding.ts +++ b/server/tests/api/transcoding/create-transcoding.ts @@ -46,6 +46,8 @@ function runTests (objectStorage: boolean) { let videoUUID: string let publishedAt: string + let shouldBeDeleted: string[] + before(async function () { this.timeout(120000) @@ -120,7 +122,7 @@ function runTests (objectStorage: boolean) { it('Should generate WebTorrent from HLS only video', async function () { this.timeout(60000) - await servers[0].videos.removeWebTorrentFiles({ videoId: videoUUID }) + await servers[0].videos.removeAllWebTorrentFiles({ videoId: videoUUID }) await waitJobs(servers) await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) @@ -140,7 +142,7 @@ function runTests (objectStorage: boolean) { it('Should only generate WebTorrent', async function () { this.timeout(60000) - await servers[0].videos.removeHLSFiles({ videoId: videoUUID }) + await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID }) await waitJobs(servers) await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) @@ -187,6 +189,12 @@ function runTests (objectStorage: boolean) { expect(videoDetails.streamingPlaylists[0].files).to.have.lengthOf(1) if (objectStorage) await checkFilesInObjectStorage(videoDetails) + + shouldBeDeleted = [ + videoDetails.streamingPlaylists[0].files[0].fileUrl, + videoDetails.streamingPlaylists[0].playlistUrl, + videoDetails.streamingPlaylists[0].segmentsSha256Url + ] } await servers[0].config.updateExistingSubConfig({ @@ -227,6 +235,12 @@ function runTests (objectStorage: boolean) { } }) + it('Should have correctly deleted previous files', async function () { + for (const fileUrl of shouldBeDeleted) { + await makeRawRequest(fileUrl, HttpStatusCode.NOT_FOUND_404) + } + }) + it('Should not have updated published at attributes', async function () { const video = await servers[0].videos.get({ id: videoUUID })