aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-25 10:57:16 +0200
committerChocobozzz <me@florianbigard.com>2022-07-25 10:57:16 +0200
commit7b6b445d91d3f0bcbb526cb1e8c1f26b96f0a971 (patch)
tree1bc9724411941e0082243164d6cc53d02902b1f7 /server/tests/api
parent4f50475c67356fb1fecd1de6d2551fdc5ad9a739 (diff)
downloadPeerTube-7b6b445d91d3f0bcbb526cb1e8c1f26b96f0a971.tar.gz
PeerTube-7b6b445d91d3f0bcbb526cb1e8c1f26b96f0a971.tar.zst
PeerTube-7b6b445d91d3f0bcbb526cb1e8c1f26b96f0a971.zip
Regenerate video filenames on transcoding
In particular when using manual transcoding, to invalidate potential HTTP caches in front of peertube
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/transcoding/create-transcoding.ts14
1 files changed, 14 insertions, 0 deletions
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) {
46 let videoUUID: string 46 let videoUUID: string
47 let publishedAt: string 47 let publishedAt: string
48 48
49 let shouldBeDeleted: string[]
50
49 before(async function () { 51 before(async function () {
50 this.timeout(120000) 52 this.timeout(120000)
51 53
@@ -187,6 +189,12 @@ function runTests (objectStorage: boolean) {
187 expect(videoDetails.streamingPlaylists[0].files).to.have.lengthOf(1) 189 expect(videoDetails.streamingPlaylists[0].files).to.have.lengthOf(1)
188 190
189 if (objectStorage) await checkFilesInObjectStorage(videoDetails) 191 if (objectStorage) await checkFilesInObjectStorage(videoDetails)
192
193 shouldBeDeleted = [
194 videoDetails.streamingPlaylists[0].files[0].fileUrl,
195 videoDetails.streamingPlaylists[0].playlistUrl,
196 videoDetails.streamingPlaylists[0].segmentsSha256Url
197 ]
190 } 198 }
191 199
192 await servers[0].config.updateExistingSubConfig({ 200 await servers[0].config.updateExistingSubConfig({
@@ -227,6 +235,12 @@ function runTests (objectStorage: boolean) {
227 } 235 }
228 }) 236 })
229 237
238 it('Should have correctly deleted previous files', async function () {
239 for (const fileUrl of shouldBeDeleted) {
240 await makeRawRequest(fileUrl, HttpStatusCode.NOT_FOUND_404)
241 }
242 })
243
230 it('Should not have updated published at attributes', async function () { 244 it('Should not have updated published at attributes', async function () {
231 const video = await servers[0].videos.get({ id: videoUUID }) 245 const video = await servers[0].videos.get({ id: videoUUID })
232 246