Verified Commit 842a1573 authored by Chocobozzz's avatar Chocobozzz
Browse files

Ensure we don't run transcoding after import file

parent 0c8af785
......@@ -7,6 +7,7 @@ import {
cleanupTests,
createMultipleServers,
doubleFollow,
expectNoFailedTranscodingJob,
expectStartWith,
makeRawRequest,
ObjectStorageCommand,
......@@ -30,11 +31,6 @@ async function checkFilesInObjectStorage (video: VideoDetails) {
}
}
async function expectNoFailedTranscodingJob (server: PeerTubeServer) {
const { data } = await server.jobs.listFailed({ jobType: 'video-transcoding' })
expect(data).to.have.lengthOf(0)
}
function runTests (objectStorage: boolean) {
let servers: PeerTubeServer[] = []
let videoUUID: string
......
......@@ -7,6 +7,7 @@ import {
cleanupTests,
createMultipleServers,
doubleFollow,
expectNoFailedTranscodingJob,
expectStartWith,
makeRawRequest,
ObjectStorageCommand,
......@@ -69,6 +70,10 @@ function runTests (objectStorage: boolean) {
}
await waitJobs(servers)
for (const server of servers) {
await server.config.enableTranscoding()
}
})
it('Should run a import job on video 1 with a lower resolution', async function () {
......@@ -139,6 +144,11 @@ function runTests (objectStorage: boolean) {
}
})
it('Should not have run transcoding after an import job', async function () {
const { data } = await servers[0].jobs.list({ jobType: 'video-transcoding' })
expect(data).to.have.lengthOf(0)
})
after(async function () {
await cleanupTests(servers)
})
......
import { expect } from 'chai'
import { JobState, JobType } from '../../models'
import { wait } from '../miscs'
import { PeerTubeServer } from './server'
......@@ -70,8 +71,14 @@ async function waitJobs (serversArg: PeerTubeServer[] | PeerTubeServer, skipDela
} while (pendingRequests)
}
async function expectNoFailedTranscodingJob (server: PeerTubeServer) {
const { data } = await server.jobs.listFailed({ jobType: 'video-transcoding' })
expect(data).to.have.lengthOf(0)
}
// ---------------------------------------------------------------------------
export {
waitJobs
waitJobs,
expectNoFailedTranscodingJob
}
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