Verified Commit 79d4eca3 authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix tests

parent d58bb3cb
......@@ -243,7 +243,7 @@ describe('Test HLS videos', function () {
enabled: true,
allowAudioFiles: true,
resolutions: {
'144p': true,
'144p': false,
'240p': true,
'360p': true,
'480p': true,
......
......@@ -227,7 +227,7 @@ describe('Test video transcoding', function () {
await waitJobs(servers)
const resolutions = [ 240, 360, 480, 720, 1080, 1440, 2160 ]
const resolutions = [ 144, 240, 360, 480, 720, 1080, 1440, 2160 ]
for (const server of servers) {
const videoDetails = await server.videos.get({ id: video4k })
......@@ -260,7 +260,7 @@ describe('Test video transcoding', function () {
const video = data.find(v => v.name === attributes.name)
const videoDetails = await server.videos.get({ id: video.id })
expect(videoDetails.files).to.have.lengthOf(4)
expect(videoDetails.files).to.have.lengthOf(5)
const file = videoDetails.files.find(f => f.resolution.id === 240)
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
......@@ -317,7 +317,7 @@ describe('Test video transcoding', function () {
const video = data.find(v => v.name === attributes.name)
const videoDetails = await server.videos.get({ id: video.id })
expect(videoDetails.files).to.have.lengthOf(4)
expect(videoDetails.files).to.have.lengthOf(5)
const fixturePath = buildAbsoluteFixturePath(attributes.fixture)
const fixtureVideoProbe = await getAudioStream(fixturePath)
......@@ -476,13 +476,14 @@ describe('Test video transcoding', function () {
const video = data.find(v => v.name === attributes.name)
const videoDetails = await server.videos.get({ id: video.id })
expect(videoDetails.files).to.have.lengthOf(4)
expect(videoDetails.files).to.have.lengthOf(5)
expect(videoDetails.files[0].fps).to.be.above(58).and.below(62)
expect(videoDetails.files[1].fps).to.be.below(31)
expect(videoDetails.files[2].fps).to.be.below(31)
expect(videoDetails.files[3].fps).to.be.below(31)
expect(videoDetails.files[4].fps).to.be.below(31)
for (const resolution of [ 240, 360, 480 ]) {
for (const resolution of [ 144, 240, 360, 480 ]) {
const file = videoDetails.files.find(f => f.resolution.id === resolution)
const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
const fps = await getVideoFileFPS(path)
......@@ -671,7 +672,7 @@ describe('Test video transcoding', function () {
const videoFiles = videoDetails.files
.concat(videoDetails.streamingPlaylists[0].files)
expect(videoFiles).to.have.lengthOf(8)
expect(videoFiles).to.have.lengthOf(10)
for (const file of videoFiles) {
expect(file.metadata).to.be.undefined
......@@ -699,21 +700,21 @@ describe('Test video transcoding', function () {
const body = await servers[1].jobs.list({
start: 0,
count: 100,
sort: '-createdAt',
sort: 'createdAt',
jobType: 'video-transcoding'
})
const jobs = body.data
const transcodingJobs = jobs.filter(j => j.data.videoUUID === video4k)
expect(transcodingJobs).to.have.lengthOf(14)
expect(transcodingJobs).to.have.lengthOf(16)
const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls')
const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent')
const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent')
expect(hlsJobs).to.have.lengthOf(7)
expect(webtorrentJobs).to.have.lengthOf(6)
expect(hlsJobs).to.have.lengthOf(8)
expect(webtorrentJobs).to.have.lengthOf(7)
expect(optimizeJobs).to.have.lengthOf(1)
for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment