Fix runner cleanup test
This commit is contained in:
parent
476ce1d7f4
commit
cfa6176381
5 changed files with 12 additions and 7 deletions
|
@ -178,7 +178,7 @@ describe('Test Live transcoding in peertube-runner program', function () {
|
|||
describe('Check cleanup', function () {
|
||||
|
||||
it('Should have an empty cache directory', async function () {
|
||||
await checkPeerTubeRunnerCacheIsEmpty()
|
||||
await checkPeerTubeRunnerCacheIsEmpty(peertubeRunner)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ describe('Test studio transcoding in peertube-runner program', function () {
|
|||
describe('Check cleanup', function () {
|
||||
|
||||
it('Should have an empty cache directory', async function () {
|
||||
await checkPeerTubeRunnerCacheIsEmpty()
|
||||
await checkPeerTubeRunnerCacheIsEmpty(peertubeRunner)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
|
|||
})
|
||||
|
||||
it('Should transcode videos on manual run', async function () {
|
||||
this.timeout(240000)
|
||||
this.timeout(360000)
|
||||
|
||||
await servers[0].config.disableTranscoding()
|
||||
|
||||
|
@ -329,7 +329,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
|
|||
describe('Check cleanup', function () {
|
||||
|
||||
it('Should have an empty cache directory', async function () {
|
||||
await checkPeerTubeRunnerCacheIsEmpty()
|
||||
await checkPeerTubeRunnerCacheIsEmpty(peertubeRunner)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import { pathExists, readdir } from 'fs-extra'
|
|||
import { homedir } from 'os'
|
||||
import { join } from 'path'
|
||||
import { PeerTubeServer } from '@shared/server-commands'
|
||||
import { PeerTubeRunnerProcess } from './peertube-runner-process'
|
||||
|
||||
export async function checkTmpIsEmpty (server: PeerTubeServer) {
|
||||
await checkDirectoryIsEmpty(server, 'tmp', [ 'plugins-global.css', 'hls', 'resumable-uploads' ])
|
||||
|
@ -30,8 +31,8 @@ export async function checkDirectoryIsEmpty (server: PeerTubeServer, directory:
|
|||
expect(filtered).to.have.lengthOf(0)
|
||||
}
|
||||
|
||||
export async function checkPeerTubeRunnerCacheIsEmpty () {
|
||||
const directoryPath = join(homedir(), '.cache', 'peertube-runner-nodejs', 'test', 'transcoding')
|
||||
export async function checkPeerTubeRunnerCacheIsEmpty (runner: PeerTubeRunnerProcess) {
|
||||
const directoryPath = join(homedir(), '.cache', 'peertube-runner-nodejs', runner.getId(), 'transcoding')
|
||||
|
||||
const directoryExists = await pathExists(directoryPath)
|
||||
expect(directoryExists).to.be.true
|
||||
|
|
|
@ -80,11 +80,15 @@ export class PeerTubeRunnerProcess {
|
|||
this.app = null
|
||||
}
|
||||
|
||||
getId () {
|
||||
return 'test-' + this.server.internalServerNumber
|
||||
}
|
||||
|
||||
private getRunnerPath () {
|
||||
return join(root(), 'packages', 'peertube-runner', 'dist', 'peertube-runner.js')
|
||||
}
|
||||
|
||||
private buildIdArg () {
|
||||
return [ '--id', 'test-' + this.server.internalServerNumber ]
|
||||
return [ '--id', this.getId() ]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue