diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-16 08:43:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-16 08:43:35 +0200 |
commit | bec4ea343987c69252b84d02f444c0f033d4a3f9 (patch) | |
tree | c0c709104aa97f1b5472a17e3e0c1436ab2dab06 /server/tests/api/videos/video-transcoder.ts | |
parent | ab5f9ed86e08cb7de3a1be955ca991a4517bdc57 (diff) | |
parent | d183ee9bda2588f07032ca4a2fce58651e684abf (diff) | |
download | PeerTube-bec4ea343987c69252b84d02f444c0f033d4a3f9.tar.gz PeerTube-bec4ea343987c69252b84d02f444c0f033d4a3f9.tar.zst PeerTube-bec4ea343987c69252b84d02f444c0f033d4a3f9.zip |
Merge branch 'feature/parallel-tests' into develop
Diffstat (limited to 'server/tests/api/videos/video-transcoder.ts')
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 3cd43e99b..45a8c09f0 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -6,21 +6,21 @@ import { omit } from 'lodash' | |||
6 | import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos' | 6 | import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos' |
7 | import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' | 7 | import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' |
8 | import { | 8 | import { |
9 | buildAbsoluteFixturePath, cleanupTests, | 9 | buildAbsoluteFixturePath, |
10 | cleanupTests, | ||
10 | doubleFollow, | 11 | doubleFollow, |
11 | flushAndRunMultipleServers, | 12 | flushAndRunMultipleServers, |
12 | generateHighBitrateVideo, | 13 | generateHighBitrateVideo, |
13 | getMyVideos, | 14 | getMyVideos, |
14 | getVideo, | 15 | getVideo, |
15 | getVideosList, | 16 | getVideosList, |
16 | killallServers, | ||
17 | root, | 17 | root, |
18 | ServerInfo, | 18 | ServerInfo, |
19 | setAccessTokensToServers, | 19 | setAccessTokensToServers, |
20 | uploadVideo, | 20 | uploadVideo, |
21 | webtorrentAdd | 21 | webtorrentAdd |
22 | } from '../../../../shared/extra-utils' | 22 | } from '../../../../shared/extra-utils' |
23 | import { extname, join } from 'path' | 23 | import { join } from 'path' |
24 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 24 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
25 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' | 25 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' |
26 | 26 | ||
@@ -121,7 +121,7 @@ describe('Test video transcoding', function () { | |||
121 | 121 | ||
122 | expect(videoDetails.files).to.have.lengthOf(4) | 122 | expect(videoDetails.files).to.have.lengthOf(4) |
123 | 123 | ||
124 | const path = join(root(), 'test2', 'videos', video.uuid + '-240.mp4') | 124 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-240.mp4') |
125 | const probe = await audio.get(path) | 125 | const probe = await audio.get(path) |
126 | 126 | ||
127 | if (probe.audioStream) { | 127 | if (probe.audioStream) { |
@@ -152,7 +152,7 @@ describe('Test video transcoding', function () { | |||
152 | const videoDetails: VideoDetails = res2.body | 152 | const videoDetails: VideoDetails = res2.body |
153 | 153 | ||
154 | expect(videoDetails.files).to.have.lengthOf(4) | 154 | expect(videoDetails.files).to.have.lengthOf(4) |
155 | const path = join(root(), 'test2', 'videos', video.uuid + '-240.mp4') | 155 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-240.mp4') |
156 | const probe = await audio.get(path) | 156 | const probe = await audio.get(path) |
157 | expect(probe).to.not.have.property('audioStream') | 157 | expect(probe).to.not.have.property('audioStream') |
158 | } | 158 | } |
@@ -179,7 +179,7 @@ describe('Test video transcoding', function () { | |||
179 | expect(videoDetails.files).to.have.lengthOf(4) | 179 | expect(videoDetails.files).to.have.lengthOf(4) |
180 | const fixturePath = buildAbsoluteFixturePath(videoAttributes.fixture) | 180 | const fixturePath = buildAbsoluteFixturePath(videoAttributes.fixture) |
181 | const fixtureVideoProbe = await audio.get(fixturePath) | 181 | const fixtureVideoProbe = await audio.get(fixturePath) |
182 | const path = join(root(), 'test2', 'videos', video.uuid + '-240.mp4') | 182 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-240.mp4') |
183 | const videoProbe = await audio.get(path) | 183 | const videoProbe = await audio.get(path) |
184 | if (videoProbe.audioStream && fixtureVideoProbe.audioStream) { | 184 | if (videoProbe.audioStream && fixtureVideoProbe.audioStream) { |
185 | const toOmit = [ 'max_bit_rate', 'duration', 'duration_ts', 'nb_frames', 'start_time', 'start_pts' ] | 185 | const toOmit = [ 'max_bit_rate', 'duration', 'duration_ts', 'nb_frames', 'start_time', 'start_pts' ] |
@@ -216,13 +216,13 @@ describe('Test video transcoding', function () { | |||
216 | expect(videoDetails.files[ 3 ].fps).to.be.below(31) | 216 | expect(videoDetails.files[ 3 ].fps).to.be.below(31) |
217 | 217 | ||
218 | for (const resolution of [ '240', '360', '480' ]) { | 218 | for (const resolution of [ '240', '360', '480' ]) { |
219 | const path = join(root(), 'test2', 'videos', video.uuid + '-' + resolution + '.mp4') | 219 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-' + resolution + '.mp4') |
220 | const fps = await getVideoFileFPS(path) | 220 | const fps = await getVideoFileFPS(path) |
221 | 221 | ||
222 | expect(fps).to.be.below(31) | 222 | expect(fps).to.be.below(31) |
223 | } | 223 | } |
224 | 224 | ||
225 | const path = join(root(), 'test2', 'videos', video.uuid + '-720.mp4') | 225 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-720.mp4') |
226 | const fps = await getVideoFileFPS(path) | 226 | const fps = await getVideoFileFPS(path) |
227 | 227 | ||
228 | expect(fps).to.be.above(58).and.below(62) | 228 | expect(fps).to.be.above(58).and.below(62) |
@@ -310,7 +310,7 @@ describe('Test video transcoding', function () { | |||
310 | const video = res.body.data.find(v => v.name === videoAttributes.name) | 310 | const video = res.body.data.find(v => v.name === videoAttributes.name) |
311 | 311 | ||
312 | for (const resolution of ['240', '360', '480', '720', '1080']) { | 312 | for (const resolution of ['240', '360', '480', '720', '1080']) { |
313 | const path = join(root(), 'test2', 'videos', video.uuid + '-' + resolution + '.mp4') | 313 | const path = join(root(), 'test' + servers[1].internalServerNumber, 'videos', video.uuid + '-' + resolution + '.mp4') |
314 | const bitrate = await getVideoFileBitrate(path) | 314 | const bitrate = await getVideoFileBitrate(path) |
315 | const fps = await getVideoFileFPS(path) | 315 | const fps = await getVideoFileFPS(path) |
316 | const resolution2 = await getVideoFileResolution(path) | 316 | const resolution2 = await getVideoFileResolution(path) |