From 7b6b445d91d3f0bcbb526cb1e8c1f26b96f0a971 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 25 Jul 2022 10:57:16 +0200 Subject: Regenerate video filenames on transcoding In particular when using manual transcoding, to invalidate potential HTTP caches in front of peertube --- server/tests/api/transcoding/create-transcoding.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server/tests/api/transcoding') diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts index a4defdf51..e3867fdad 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) @@ -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 }) -- cgit v1.2.3