X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-transcoding.ts;h=ce1047388383176290e3133bfeaee3ebb898f418;hb=b1dbb9fefc870a90b25f5c0153589f45c9e75e3e;hp=c14c34c7ec774dd22714d8ec805f8c1cb7e7da4f;hpb=c4fa01f7c45b66b112ebd08abce744b7c4041feb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts index c14c34c7e..ce1047388 100644 --- a/server/tests/plugins/plugin-transcoding.ts +++ b/server/tests/plugins/plugin-transcoding.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' import { expect } from 'chai' -import { join } from 'path' -import { getAudioStream, getVideoFileFPS, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' +import { getAudioStream, getVideoStreamFPS, getVideoStream } from '@server/helpers/ffmpeg' +import { VideoPrivacy } from '@shared/models' import { cleanupTests, createSingleServer, @@ -13,8 +12,7 @@ import { setDefaultVideoChannel, testFfmpegStreamError, waitJobs -} from '@shared/extra-utils' -import { VideoPrivacy } from '@shared/models' +} from '@shared/server-commands' async function createLiveWrapper (server: PeerTubeServer) { const liveAttributes = { @@ -93,7 +91,7 @@ describe('Test transcoding plugins', function () { async function checkLiveFPS (uuid: string, type: 'above' | 'below', fps: number) { const playlistUrl = `${server.url}/static/streaming-playlists/hls/${uuid}/0.m3u8` - const videoFPS = await getVideoFileFPS(playlistUrl) + const videoFPS = await getVideoStreamFPS(playlistUrl) if (type === 'above') { expect(videoFPS).to.be.above(fps) @@ -247,11 +245,13 @@ describe('Test transcoding plugins', function () { const videoUUID = (await server.videos.quickUpload({ name: 'video', fixture: 'video_very_short_240p.mp4' })).uuid await waitJobs([ server ]) - const path = server.servers.buildDirectory(join('videos', videoUUID + '-240.mp4')) + const video = await server.videos.get({ id: videoUUID }) + + const path = server.servers.buildWebTorrentFilePath(video.files[0].fileUrl) const audioProbe = await getAudioStream(path) expect(audioProbe.audioStream.codec_name).to.equal('opus') - const videoProbe = await getVideoStreamFromFile(path) + const videoProbe = await getVideoStream(path) expect(videoProbe.codec_name).to.equal('vp9') }) @@ -268,7 +268,7 @@ describe('Test transcoding plugins', function () { const audioProbe = await getAudioStream(playlistUrl) expect(audioProbe.audioStream.codec_name).to.equal('opus') - const videoProbe = await getVideoStreamFromFile(playlistUrl) + const videoProbe = await getVideoStream(playlistUrl) expect(videoProbe.codec_name).to.equal('h264') }) })