Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix runner cleanup test

Chocobozzzcfa617638129
diff --git a/server/tests/peertube-runner/live-transcoding.ts b/server/tests/peertube-runner/live-transcoding.ts
index c56f4cd84f..17e1f30780 100644
--- a/server/tests/peertube-runner/live-transcoding.ts
+++ b/server/tests/peertube-runner/live-transcoding.ts
@@ -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)
})
})
diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.ts
index f60b83dbd6..400203eb33 100644
--- a/server/tests/peertube-runner/studio-transcoding.ts
+++ b/server/tests/peertube-runner/studio-transcoding.ts
@@ -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)
})
})
diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.ts
index 02d839339a..f1670c1fb4 100644
--- a/server/tests/peertube-runner/vod-transcoding.ts
+++ b/server/tests/peertube-runner/vod-transcoding.ts
@@ -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)
})
})
diff --git a/server/tests/shared/directories.ts b/server/tests/shared/directories.ts
index 4f42825541..22578bc0e8 100644
--- a/server/tests/shared/directories.ts
+++ b/server/tests/shared/directories.ts
@@ -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
diff --git a/server/tests/shared/peertube-runner-process.ts b/server/tests/shared/peertube-runner-process.ts
index 6ad2cd1160..b3c8dfe0e8 100644
--- a/server/tests/shared/peertube-runner-process.ts
+++ b/server/tests/shared/peertube-runner-process.ts
@@ -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() ]
}
}