mirror of https://github.com/Chocobozzz/PeerTube
Ensure we don't run transcoding after import file
parent
0c8af78521
commit
842a15732b
|
@ -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)
|
||||
})
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue