diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-04 15:29:34 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 5e47f6ab984a7d00782e4c7030afffa1ba480add (patch) | |
tree | 1ce586b591a8d71acbc301eba29b9a5e6490439e /server/tests/shared/checks.ts | |
parent | 6a4905602636afd6650c9e6f4d0fcc2105d91100 (diff) | |
download | PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.gz PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.tar.zst PeerTube-5e47f6ab984a7d00782e4c7030afffa1ba480add.zip |
Support studio transcoding in peertube runner
Diffstat (limited to 'server/tests/shared/checks.ts')
-rw-r--r-- | server/tests/shared/checks.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/shared/checks.ts b/server/tests/shared/checks.ts index d7eb25bb5..feaef37c6 100644 --- a/server/tests/shared/checks.ts +++ b/server/tests/shared/checks.ts | |||
@@ -130,6 +130,22 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer | |||
130 | }) | 130 | }) |
131 | } | 131 | } |
132 | 132 | ||
133 | // --------------------------------------------------------------------------- | ||
134 | |||
135 | async function checkVideoDuration (server: PeerTubeServer, videoUUID: string, duration: number) { | ||
136 | const video = await server.videos.get({ id: videoUUID }) | ||
137 | |||
138 | expect(video.duration).to.be.approximately(duration, 1) | ||
139 | |||
140 | for (const file of video.files) { | ||
141 | const metadata = await server.videos.getFileMetadata({ url: file.metadataUrl }) | ||
142 | |||
143 | for (const stream of metadata.streams) { | ||
144 | expect(Math.round(stream.duration)).to.be.approximately(duration, 1) | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
133 | export { | 149 | export { |
134 | dateIsValid, | 150 | dateIsValid, |
135 | testImageSize, | 151 | testImageSize, |
@@ -142,5 +158,6 @@ export { | |||
142 | checkBadStartPagination, | 158 | checkBadStartPagination, |
143 | checkBadCountPagination, | 159 | checkBadCountPagination, |
144 | checkBadSortPagination, | 160 | checkBadSortPagination, |
161 | checkVideoDuration, | ||
145 | expectLogContain | 162 | expectLogContain |
146 | } | 163 | } |