aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-01 11:16:45 +0100
committerChocobozzz <me@florianbigard.com>2022-02-01 11:27:38 +0100
commit0f11ec8dd32b50897c18588db948e96cf0fc2c70 (patch)
tree49be9328b4dd5ac8d989ccbe157f494d85246618 /server/tests
parent3e8c3fcdb063e2d8f4b3ba04fdcdeda588538751 (diff)
downloadPeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.tar.gz
PeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.tar.zst
PeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.zip
Prevent HLS transcoding after webtorrent transcoding
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/videos/video-create-transcoding.ts25
1 files changed, 24 insertions, 1 deletions
diff --git a/server/tests/api/videos/video-create-transcoding.ts b/server/tests/api/videos/video-create-transcoding.ts
index 62a6bab0d..dcdbd9c6e 100644
--- a/server/tests/api/videos/video-create-transcoding.ts
+++ b/server/tests/api/videos/video-create-transcoding.ts
@@ -25,7 +25,11 @@ async function checkFilesInObjectStorage (video: VideoDetails) {
25 await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) 25 await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200)
26 } 26 }
27 27
28 for (const file of video.streamingPlaylists[0].files) { 28 const streamingPlaylistFiles = video.streamingPlaylists.length === 0
29 ? []
30 : video.streamingPlaylists[0].files
31
32 for (const file of streamingPlaylistFiles) {
29 expectStartWith(file.fileUrl, ObjectStorageCommand.getPlaylistBaseUrl()) 33 expectStartWith(file.fileUrl, ObjectStorageCommand.getPlaylistBaseUrl())
30 await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) 34 await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200)
31 } 35 }
@@ -127,6 +131,25 @@ function runTests (objectStorage: boolean) {
127 } 131 }
128 }) 132 })
129 133
134 it('Should only generate WebTorrent', async function () {
135 this.timeout(60000)
136
137 await servers[0].videos.removeHLSFiles({ videoId: videoUUID })
138 await waitJobs(servers)
139
140 await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' })
141 await waitJobs(servers)
142
143 for (const server of servers) {
144 const videoDetails = await server.videos.get({ id: videoUUID })
145
146 expect(videoDetails.files).to.have.lengthOf(5)
147 expect(videoDetails.streamingPlaylists).to.have.lengthOf(0)
148
149 if (objectStorage) await checkFilesInObjectStorage(videoDetails)
150 }
151 })
152
130 it('Should not have updated published at attributes', async function () { 153 it('Should not have updated published at attributes', async function () {
131 const video = await servers[0].videos.get({ id: videoUUID }) 154 const video = await servers[0].videos.get({ id: videoUUID })
132 155